Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#348061 - 14/10/2011 07:51 Can I configure a UPS to always run from the battery?
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
My electricity supply at home is being squirrely. The power company are installing a voltage recorder today, but they'll not do anything until they've monitored the situation for a while.

I've currently got an APC UPS, but I've stopped using it because it keeps clicking (when the relays switch to battery) and beeping (when the power does drop out for too long). This is annoying. Is there any way I can switch it to always run from the battery, as a laptop does?
_________________________
-- roger

Top
#348062 - 14/10/2011 08:46 Re: Can I configure a UPS to always run from the battery? [Re: Roger]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4180
Loc: Cambridge, England
Dunno, but I do have some non-answers to your question: you can set the input sensitivity, the transfer voltages (i.e. how far out of spec the voltage has to be before it disdains the mains) and you can turn off the beeping.

With Linux apctest, that's "SENSITIVITY L", "LOTRANSFER 196", "HITRANSFER 265" and "BEEPSTATE N" in /etc/apcupsd.conf.

Peter

Top
#348063 - 14/10/2011 09:40 Re: Can I configure a UPS to always run from the battery? [Re: peter]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: peter
With Linux apctest, that's "SENSITIVITY L", "LOTRANSFER 196", "HITRANSFER 265" and "BEEPSTATE N" in /etc/apcupsd.conf.


Thanks Peter; that's exactly what I need.
_________________________
-- roger

Top
#348064 - 14/10/2011 10:21 Re: Can I configure a UPS to always run from the battery? [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
BEEPSTATE L is probably safer, in case you forget to re-edit the file once issues with the mains are resolved. It will still mute the beeps, but reenable them when the battery is nearly exhausted.

Cheers

Top
#348066 - 14/10/2011 11:04 Re: Can I configure a UPS to always run from the battery? [Re: mlord]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4180
Loc: Cambridge, England
I had to set HITRANSFER to be more forgiving as soon as I got mine: Cambridge mains is notoriously high.

Peter

Top
#348067 - 14/10/2011 11:39 Re: Can I configure a UPS to always run from the battery? [Re: peter]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: peter
I had to set HITRANSFER to be more forgiving as soon as I got mine: Cambridge mains is notoriously high.

Peter


Oh, and is there any way with current apcupsd to record the UPS values every 5 seconds or so? Preferably to CSV. I know I've done it in the past, but I can't remember how.
_________________________
-- roger

Top
#348075 - 14/10/2011 17:32 Re: Can I configure a UPS to always run from the battery? [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
Code:
#!/bin/sh
while sleep 5 ; do
    apcaccess | awk '/^LINEV/{print strftime("%F %F", systime()) " " $3 >> "/tmp/line_voltages.txt"}'
done

Top
#348082 - 15/10/2011 06:18 Re: Can I configure a UPS to always run from the battery? [Re: mlord]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: mlord
Code:
#!/bin/sh
while sleep 5 ; do
    apcaccess | awk '/^LINEV/{print strftime("%F %F", systime()) " " $3 >> "/tmp/line_voltages.txt"}'
done



Thanks Mark, but I have another question:

That only samples the instantaneous value; my power's more intermittently bad than that. Is there any way to sample continuously, but (say) log the min/max values from each 5 minute period?

I'm sure something can be done with judicious amounts of sed or awk or perl, but I dimly remember this being built-in with older apcupsd.
_________________________
-- roger

Top
#348083 - 15/10/2011 10:42 Re: Can I configure a UPS to always run from the battery? [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
I don't know much about the sampling capabilities for apcupsd. But "continuous" at some point must be translated to a discrete sampling interval.

So, yes, one can modify the script to do what you suggest.
Want it? It's pretty simple for me to do.

cheers

Top
#348085 - 15/10/2011 11:09 Re: Can I configure a UPS to always run from the battery? [Re: Roger]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4180
Loc: Cambridge, England
Originally Posted By: Roger
I dimly remember this being built-in with older apcupsd

It is built-in, sort of. When you run apcaccess, it returns the latest status page from the device. The status page is updated about once a minute (about every 62s on mine), as timestamped by the "DATE:" line. The "MAXLINEV:" and "MINLINEV:" lines give the range of line voltage since the last status page (or possibly since the last one that was asked for... the documentation isn't very clear).

Edit: In fact some of the other documentation says it's the range since apcupsd was started. But if so, all you probably need to do is run apcaccess at *:59 and restart apcupsd on the hour...

Peter

Top
#348086 - 15/10/2011 11:45 Re: Can I configure a UPS to always run from the battery? [Re: mlord]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: mlord
I don't know much about the sampling capabilities for apcupsd. But "continuous" at some point must be translated to a discrete sampling interval.


Granted. OK. Here's the problem:

When the power browns out, it's usually out for less than a second. This would imply a sampling rate of around 10 times a second to be in with a fighting chance of catching it, which is going to rapidly fill up my disk with logfile.

When the power browns out, apcupsd is notified immediately. so it would make sense to grab MINLINEV at this point. Except that it's not reset between events.

Oh, and we've just changed the UPS so that it's not so sensitive, which means it won't trigger. Hmmm.

I guess what I need is something that samples (say) 10 times a second, but only logs the value when the line voltage is outside a defined envelope (or when it transitions between in-spec and out-of-spec, maybe).

I'll look at cooking something up later...
_________________________
-- roger

Top
#348089 - 15/10/2011 13:15 Re: Can I configure a UPS to always run from the battery? [Re: peter]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
Originally Posted By: peter
The "MAXLINEV:" and "MINLINEV:" lines give the range of line voltage since the last status page (or possibly since the last one that was asked for... the documentation isn't very clear).

My understanding is that apcaccess just dumps data directly from the UPS. My particular UPS here doesn't report MAXLINEV or MINLINEV. EDIT: or maybe not.. I wonder how to get just the raw info?

Roger, what does yours report from running apcaccess ?


Edited by mlord (15/10/2011 13:20)

Top
#348090 - 15/10/2011 13:19 Re: Can I configure a UPS to always run from the battery? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
Here's a dump from one of my two UPSs:
Code:
APC      : 001,037,0920
DATE     : 2011-10-15 11:17:45 -0400  
HOSTNAME : duke
VERSION  : 3.14.8 (16 January 2010) debian
UPSNAME  : duke_ups
CABLE    : USB Cable
MODEL    : Back-UPS XS 1300 LCD 
UPSMODE  : Stand Alone
STARTTIME: 2011-10-15 11:17:25 -0400  
STATUS   : ONLINE 
LINEV    : 126.0 Volts
LOADPCT  :   9.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  66.7 Minutes
MBATTCHG : 10 Percent
MINTIMEL : 5 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 088.0 Volts
HITRANS  : 139.0 Volts
ALARMDEL : Low Battery
BATTV    : 26.5 Volts
LASTXFER : Low line voltage
NUMXFERS : 0
TONBATT  : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
MANDATE  : 2008-05-15
SERIALNO : BB0820009163  
BATTDATE : 2008-05-15
NOMINV   : 120 Volts
NOMBATTV :  24.0 Volts
NOMPOWER : 780 Watts
FIRMWARE : 836.H8 .D USB FW:H8
APCMODEL : Back-UPS XS 1300 LC
END APC  : 2011-10-15 11:17:46 -0400

Top
#348091 - 15/10/2011 13:20 Re: Can I configure a UPS to always run from the battery? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
And this is from the other one here:
Code:
APC      : 001,043,1048
DATE     : Sat Oct 15 11:18:59 EDT 2011
HOSTNAME : atom
VERSION  : 3.14.6 (16 May 2009) debian
UPSNAME  : atom_UPS
CABLE    : USB Cable
MODEL    : Back-UPS RS 900 
UPSMODE  : Stand Alone
STARTTIME: Wed Oct 12 21:20:32 EDT 2011
STATUS   : ONLINE 
LINEV    : 126.0 Volts
LOADPCT  :   7.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT : 108.0 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 4 Minutes
MAXTIME  : 0 Seconds
OUTPUTV  : 120.0 Volts
SENSE    : Medium
DWAKE    : 000 Seconds
DSHUTD   : 000 Seconds
LOTRANS  : 097.0 Volts
HITRANS  : 139.0 Volts
RETPCT   : 000.0 Percent
ITEMP    : 29.2 C Internal
ALARMDEL : Low Battery
BATTV    : 27.4 Volts
LINEFREQ : 60.0 Hz
LASTXFER : Low line voltage
NUMXFERS : 0
TONBATT  : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
SERIALNO : QB0628132519  
BATTDATE : 2001-09-25
NOMOUTV  : 120 Volts
NOMINV   : 120 Volts
NOMBATTV :  24.0 Volts
NOMPOWER : 540 Watts
FIRMWARE : 9.o1 .D USB FW:o1 
APCMODEL : Back-UPS RS 900 
END APC  : Sat Oct 15 11:19:36 EDT 2011

Top
#348092 - 15/10/2011 13:34 Re: Can I configure a UPS to always run from the battery? [Re: mlord]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4180
Loc: Cambridge, England
Oh. Mine is a SmartUPS. Perhaps that makes it smarter than the average UPS?
Code:
APC      : 001,051,1216
DATE     : Sat Oct 15 14:31:49 BST 2011
HOSTNAME : jalfrezi
RELEASE  : 3.12.3
VERSION  : 3.12.3 (26 April 2006) unknown
UPSNAME  : UPS_IDEN
CABLE    : Custom Cable Smart
MODEL    : Smart-UPS 750
[...]
MAXLINEV : 249.1 Volts
MINLINEV : 247.6 Volts
OUTPUTV  : 247.6 Volts
[...]
FIRMWARE : 651.12.I
APCMODEL : FWI
END APC  : Sat Oct 15 14:32:27 BST 2011

Peter

Top
#348095 - 15/10/2011 14:02 Re: Can I configure a UPS to always run from the battery? [Re: peter]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: peter
Oh. Mine is a SmartUPS.


So's mine:

Code:
APC      : 001,048,1152
DATE     : Sat Oct 15 17:01:34 BST 2011
HOSTNAME : acer
VERSION  : 3.14.6 (16 May 2009) debian
UPSNAME  : UPS_IDEN
CABLE    : Custom Cable Smart
MODEL    : Smart-UPS SC620
[...]
MAXLINEV : 236.1 Volts
MINLINEV : 233.2 Volts
OUTPUTV  : 233.2 Volts
[...]
FIRMWARE : 726.1.I
APCMODEL : CWI
END APC  : Sat Oct 15 17:01:40 BST 2011
_________________________
-- roger

Top
#348097 - 15/10/2011 15:14 Re: Can I configure a UPS to always run from the battery? [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
My Smart-UPS died a couple of years ago -- just ate new batteries, so I recycled the metals and turfed the rest of it.

Top