Unfortunately APC doesn't ship proper documentation with their power supplies. This forces Unix users to guess at how the ad-hoc APC serial-line protocol works. Luckily the important details are documented on the net and some of the other minor details are easy enough to guess at.
This is what I've been able to dig up about the APC Smartups serial protocol:
Other obscure protocol tidbits:
The cable is not a straight through cable. It requires the following cross-over for a db-9 to db-9 cable:
pc ups
2 2
3 1
5 9
The UPS powers up in a dumb mode. It appears to periodically send various combinations of punctuation.
'?' at power up or when reverting to dumb mode
'$' online and all is well
'!' power failure, running on battery
'%' the battery is discharged
'+' the battery is recharged
'*' test mode
'|' wrote new eeprom value
One first has to send the UPS a 'Y' before it goes into smart mode and does anything interesting. It will eventually time out, so prepend a 'Y' to the command if you haven't sent anything in a while.
The commands in the rkroll description do the obvious things for the most part. One command that requires a bit of explaination is the "^Z" command. The "^Z" command prints out an ascii list of multiple choice values that one may choose for the UPS's various settings. The format is a scrunched together list as follows (with newlines for printability):
#uD43127130133136uA43108110112114uI43253257261265lD4310
6103100097lA43092090088086lI43208204200196e44200155090o
D13115oJ13100oI13230s441HMLLq44202050710p44302018030060
0k4410TLNr443000060180300E443336168ON OFF
'#' leading char
'u' variable name
'D' random descriptor
'4' 4 groupings ...
'3' ... of 3 chars each (eg. 12 chars altogether)
and then 12 chars of values:
127 130 133 136
Or hand edited into logical clumps with my commentary along the right side:
#
uD43127130133136 upper limit 4*3 127 130 133 136
uA43108110112114 ??? 4*3 108 110 112 114
uI43253257261265 ??? 4*3 253 257 261 265
lD43106103100097 lower limit 4*3 106 103 100 097
lA43092090088086 ??? 4*3 092 090 088 086
lI43208204200196 ??? 4*3 208 204 200 196
e44200155090 power up batt 4*2 00 15 50 90
oD13115 ouput voltage 1*3 115
oJ13100 ??? 1*3 100
oI13230 ??? 1*3 230
s441HMLL sensitivity 4*1 H M L L
q44202050710 low bat warning 4*2 02 05 07 10
p443020180300600 pwr down delay 4*3 020 180 300 600
k4410TLN alarm delay 4*1 0 T L N
r443000060180300 return delay 4*3 000 060 180 300
E443336168ON OFF self test delay 4*3 336 168 ON OFF
I'm guessing that the second char in the above clumps is 'D' for domestic, 'I' for international, 'A' for ??? 'J' for Japan. Eg. Alternate voltage choices D = 115v, I = 230v, J/A = 100v. The alternate clumps are really uninteresting for a Unix daemon, its just kind of curious that they would bother documenting something the hardware probably can't do.
Most of the below stuff is from rkroll (smartupstools). Some is from pavel (apcd) and alexis (upsd). -wsr
Code Meaning My results
^A Model string SMART-UPS 700
^N Turn on UPS n/a
^Z capabilities long ascii string of capabilities.
@nnn soft powerdown
for nnn 1/10ths
hrs. (pavelk)
+ change prev setting (next choice)
+ battery change date in MM/DD/YY
- change prev setting (prev choice)
7 option switch settings "NA"
8 unknown "00"
9 unknown "FF"
A Front panel Light show + "OK"
test
B Battery Ranges - typical "27.87"
voltage
Internal
C temperature Ranges - typical "036.0"
(degrees C)
D Toggles ! when on battery, $ on line
line/battery
pavel: runtime calibration
Automatic
E selftest Default = 336 (14 days) (336=14 days, 168=7 days, ON=power on,
intervals OFF=never)
F Line 60.00
frequency, Hz
G Unknown "R" "S" or "T" "L"
pavel: past history since last test (U command).
T - power failure during online
S - no power failure
R -
L - power failure during sleep
Shutdown with
K grace period, n/a
issue twice
L Input line Ranges - typical "118.3"
voltage
Minimum line
M voltage Ranges - typical "118.9"
received
Maximum line
N voltage Ranges - typical "118.9"
received
O Output Ranges - typical "118.3"
voltage
P Power load % Ranges - typical "000.0"
Q Status flags Bitmapped, see below
R Turn dumb "BYE"
S pavel: soft shutdown
ups returns online
after power returns
U Self test !! when switching to battery, then $ when back on line
pavel: resets some statistics
V Firmware "GWD"
revision
W Self test "OK"
X Unknown "OK" or "NO"
pavelk: switch
back online
Y Enter smart "SM"
mode
Shutdown
Z immediately,
issue twice
' unknown "NA"
a Show valid 3.!$%+?=#|.^A^N^Z+-789<@ABCDEFGKLMNOPQRSUVWXYZ'abcefgjklmnopqrsuvzy~^?
commands
b Firmware 50.9.D
revision
c UPS local id UPS_IDEN
e Return % battery charge threshold for return(00=00%, 01=15%, 02=50%, 03=90%)
threshhold
f Battery level Ranges - typical "099.0"
%
g Battery Ranges - typical "024"
voltage
j Unknown "0327:"
wsr: est. runtime at current load. (minutes)
k Alarm delay 0=5 second delay after fail/T=30 second delay/L=alarm at low battery
only/N=no alarm
l Low transfer Default "103"
voltage
m Manufacturing Unique within groups of UPSes (production runs)
date
n Serial number Unique for each UPS
o Output Default "115"
voltage
Shutdown
p grace delay, Default "020"
seconds
Low battery
q warning, Default "02"
minutes
Shutdown
r return delay, Default "000"
seconds
s Sensitivity H/M/L/L
Upper
u transfer Default "132"
voltage
v unknown "NA"
x Last battery Varies
change
y Copyright (C) APCC
notice
z Unknown "CLEAR"
wsr: clear settings to factory default
doesn't effect ident ('c').
~ unknown "00"
^? [delete] unknown "NA"
Status bits
Some common things you'll see:
* 08 = on line, battery OK
* 10 = on battery, battery OK
* 50 = on battery, battery low
Bit Meaning
0 1 = calibration
1 1 = sleeping?
2 1 = SmartBoost
3 1 = on line
4 1 = on battery
5 Unknown/unused (value = 20)
6 1 = battery low (value = 40)
7 1 = charging? (value = 80)
pavelk: replace battery
#
# wsrcc init strings:
#
z clear to factory defaults
e+ charge to 15% battery before turning back on.
r+ 60 seconds of line power before turning back on.
#
# end
#
If anyone figures out any other stuff about this crazy protocol please drop me a note.
The information here was either found on the net or was figured out by typing at the serial line and seeing what the UPS did. None of this information was obtained under any NDA.
Smartups is probably a trademark or something or other of APC. If you are really curious, send a note to them and ask.
wolfgang.rupprecht+web@gmail.com
(Wolfgang S. Rupprecht)
WSRCC Home Page || Up One
Level
..