Discussion:
[Apcupsd-users] APS Back-UPS Pro 1400 cabling---exactly what do I need?
f***@media.mit.edu
2007-07-28 19:51:52 UTC
Permalink
I've got an APS Back-UPS Pro 1400 that I'd like to use with apcupsd,
but the documentation seems vague on cabling. I can see on page 130
of the PDF version of the manual that the recommended cable is a
940-0095A, complete w/its transistor etc, and the description there
talks about only how the "dumb" lines get controlled. Yet page 15
claims that this UPS speaks "apcsmart" protocol, and [1] claims that
this UPS can in fact speak -both- protocols simultaneously, but even
if that's true, which signalling protocol will apcupsd use?

So here's the question: Do I -have- to get:
(a) one of the 940-0095A's (or build one myself) if I intend to use
this UPS with apcupsd only (not APC's own software), or
(b) can I use the 940-0024C cable, or
(c) build what the manual calls a "smart-custom" cable on page 121?

Will apcupsd -only- try to use ASCII to talk to the UPS, or will it
assume it's got the "dumb" control lines 'cause it's a Back-UPS Pro?
Will the UPS freak out if all the other control lines are left
unconnected?

Thanks!

[And it seems that any definitive answer on this should be included in
the otherwise remarkably complete and informative documentation for
apcupsd...]

[1] http://lists.alioth.debian.org/pipermail/nut-upsuser/2005-August/000118.html
Adam Kropelin
2007-07-28 22:06:46 UTC
Permalink
Post by f***@media.mit.edu
I've got an APS Back-UPS Pro 1400
I'm sorry. Really, I am.
Post by f***@media.mit.edu
that I'd like to use with apcupsd,
but the documentation seems vague on cabling.
That's a very polite way to put it.
Post by f***@media.mit.edu
I can see on page 130
of the PDF version of the manual that the recommended cable is a
940-0095A, complete w/its transistor etc, and the description there
talks about only how the "dumb" lines get controlled. Yet page 15
claims that this UPS speaks "apcsmart" protocol, and [1] claims that
this UPS can in fact speak -both- protocols simultaneously, but even
if that's true, which signalling protocol will apcupsd use?
Welcome to the twisted and confusing world of the BackUPS Pro, quite
possibly the worst family of UPSes APC ever made (at least from a
communication and control perspective). The BackUPS Pro is a painful
rash on an otherwise pretty solid brand. I keep hoping the Pros will
disappear as time passes, but folks keep digging them out of closets and
trying to use them. Poor fools. (I mean that in the nicest possible
way.)

There are a variety of Pro models capable of communicating via smart
serial, dumb serial, USB, and various combinations of the three. I know
of no absolute reference as to which models support which cable types
and what cable part numbers are appropriate for use with each. Google
and the apcupsd-users list archives are your best bet for finding
known-working setups.

That said, poking at the source code and staring at cable diagrams I can
make some educated guesses...
Post by f***@media.mit.edu
(a) one of the 940-0095A's (or build one myself) if I intend to use
this UPS with apcupsd only (not APC's own software), or
Assuming your UPS has a 9 pin serial connector (and not a USB jack or an
RJ45-10 jack), this cable is likely to have the best chance of working.
(If you have the option of using USB, please do...BackUPS Pro USB
firmware is laughably buggy, but at least it basically functions and
there are a handful of folks on the list running with that
configuration.) If you have to use serial, the 95A cable seems like the
best choice.
Post by f***@media.mit.edu
(b) can I use the 940-0024C cable, or
I do not believe the 24C will work. This is the standard smart serial
cable and APC would never have kept the Pro line compatible with
that...it just wouldn't fit the pain-and-frustration motif.
Post by f***@media.mit.edu
(c) build what the manual calls a "smart-custom" cable on page 121?
The smart-custom is really just a 24C without the loopback detect pins,
so same comment applies as above.
Post by f***@media.mit.edu
Will apcupsd -only- try to use ASCII to talk to the UPS, or will it
assume it's got the "dumb" control lines 'cause it's a Back-UPS Pro?
Apcupsd will obey your UPSTYPE setting in apcupsd.conf.

For smart operation (preferred), set...

UPSCABLE 940-0095A
UPSTYPE apcsmart
DEVICE /dev/whatever

...and for simple signalling, set...

UPSTYPE dumb
Post by f***@media.mit.edu
Will the UPS freak out if all the other control lines are left
unconnected?
Possibly. But it might get over it. If you're going to build your own
cable, I'd suggest starting with the 95A diagram and wire only the SG,
TXD, RTS, and RXD lines. That would appear to be the minimal set to get
smart mode working on a Pro (assuming your particular Pro supports smart
mode at all). If it works, you're done. If not, keep adding stuff (and
also testing 'dumb' mode) until it does. I know, not a very reassuring
suggestion, but it's the best I have...
Post by f***@media.mit.edu
[And it seems that any definitive answer on this should be included in
the otherwise remarkably complete and informative documentation for
apcupsd...]
Yeah..."definitive". The only definitive statement that I'm willing to
make about the Pro is not fit to be printed. (That said, please report
any success/failure you have with your cable to apcupsd-users so it'll
end up as part of the collective knowledge in the archive.)

--Adam
Andrew Ruscica
2007-07-29 03:19:07 UTC
Permalink
Post by Adam Kropelin
Post by f***@media.mit.edu
(b) can I use the 940-0024C cable, or
I do not believe the 24C will work. This is the standard smart serial
cable and APC would never have kept the Pro line compatible with
that...it just wouldn't fit the pain-and-frustration motif.
I am successfully using a BackUPS Pro 650 with a 940-0024B. I don't know
how different it is from a 24C.

I'm using:

UPSCABLE 940-0024B
UPSTYPE apcsmart

UPSCABLE smart also works.

I ended up using this after giving up on a BackUPS ES 725.

--A
Adam Kropelin
2007-07-29 12:55:36 UTC
Permalink
Post by Andrew Ruscica
Post by Adam Kropelin
Post by f***@media.mit.edu
(b) can I use the 940-0024C cable, or
I do not believe the 24C will work. This is the standard smart serial
cable and APC would never have kept the Pro line compatible with
that...it just wouldn't fit the pain-and-frustration motif.
I am successfully using a BackUPS Pro 650 with a 940-0024B. I don't
know how different it is from a 24C.
According to a diagram I found on the net [0] it is different from the
24C [1]. But it's a nice simple 4-wire cable, so it's worth a try...

--Adam

[0] <http://www.nullmodem.com/ups.htm>
[1]
<http://www.apcupsd.com/manual/Cables.html#SECTION000318400000000000000>
Trevor Roydhouse
2007-07-29 13:15:03 UTC
Permalink
Post by Adam Kropelin
Yeah..."definitive". The only definitive statement that I'm willing to
make about the Pro is not fit to be printed. (That said, please report
any success/failure you have with your cable to apcupsd-users so it'll
end up as part of the collective knowledge in the archive.)
This works for me:

UPSCABLE smart
UPSTYPE backupspro

UPS stats, firmware version etc...

APC : 001,031,0802
DATE : Sun Jul 29 23:07:47 EST 2007
HOSTNAME : shadow.sentry.org
RELEASE : 3.14.1
VERSION : 3.14.1 (04 May 2007) freebsd
UPSNAME : SHADOW
CABLE : Custom Cable Smart
MODEL : BACK-UPS PRO 1400
UPSMODE : Stand Alone
STARTTIME: Mon Jul 23 00:17:53 EST 2007
LINEFAIL : OK
BATTSTAT : OK
MAINS : OK
STATFLAG : 0x07000008 Status Flag
STATUS : ONLINE
MBATTCHG : -1 Percent
MINTIMEL : 5 Minutes
MAXTIME : 0 Seconds
LASTXFER : Low line voltage
NUMXFERS : 32
XONBATT : Sun Jul 29 19:37:55 EST 2007
TONBATT : 0 seconds
CUMONBATT: 31 seconds
XOFFBATT : Sun Jul 29 19:37:56 EST 2007
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
REG1 : 0x00 Register 1
REG2 : 0x00 Register 2
REG3 : 0x00 Register 3
SERIALNO : QB0306322164
FIRMWARE : 14.J.I
END APC : Sun Jul 29 23:07:54 EST 2007

Cheers,
TREV.
--
Trevor Roydhouse Mob : 0415-448-273
BJuris, LLB, LLM (UNSW)
System Developer
Australasian Legal Information Institute Web : www.austlii.edu.au
Adam Kropelin
2007-07-29 13:17:43 UTC
Permalink
Post by Andrew Ruscica
UPSCABLE smart
UPSTYPE backupspro
What cable are you using, Trev?

--Adam
Trevor Roydhouse
2007-07-29 13:24:15 UTC
Permalink
Post by Adam Kropelin
Post by Andrew Ruscica
UPSCABLE smart
UPSTYPE backupspro
What cable are you using, Trev?
CABLE : Custom Cable Smart

I believe I've also tried the official 95A one and it was no better or
worse so I left the custom smart one I made on the UPS.

I also just noticed that the apcaccess status listing I sent had
duplicated the STATFLAG item. Possible bug?
--
Trevor Roydhouse Mob : 0415-448-273
BJuris, LLB, LLM (UNSW)
System Developer
Australasian Legal Information Institute Web : www.austlii.edu.au
Adam Kropelin
2007-07-29 13:33:19 UTC
Permalink
Post by Trevor Roydhouse
Post by Adam Kropelin
Post by Andrew Ruscica
UPSCABLE smart
UPSTYPE backupspro
What cable are you using, Trev?
CABLE : Custom Cable Smart
That comes directly from the "UPSCABLE smart" in your apcupsd.conf ...
it isn't detected so I wanted to check and make sure that's the cable
you actually have hooked up.
Post by Trevor Roydhouse
I believe I've also tried the official 95A one and it was no better or
worse so I left the custom smart one I made on the UPS.
Ok, good to know.
Post by Trevor Roydhouse
I also just noticed that the apcaccess status listing I sent had
duplicated the STATFLAG item. Possible bug?
Hmmm...that's amusing. I'll look into it. I suspect it's related to the
"UPSTYPE backupspro" setting since "backupspro" is an obsolete setting.
It's mapped to "apcsmart", but I wouldn't be surprised if there's some
legacy code still triggering off of it.

--Adam
f***@media.mit.edu
2007-07-29 02:22:10 UTC
Permalink
Date: Sat, 28 Jul 2007 18:06:46 -0400
Post by f***@media.mit.edu
I've got an APS Back-UPS Pro 1400
I'm sorry. Really, I am.
Yeah, well. I've had 4 of those and one SmartUPS 1400 for several
years now, all from surplus, but they've been running unmonitored.
Time to fix that, I think, but not worth buying several new UPSes
just for that.
There are a variety of Pro models capable of communicating via smart
serial, dumb serial, USB, and various combinations of the three. I know
of no absolute reference as to which models support which cable types
and what cable part numbers are appropriate for use with each. Google
and the apcupsd-users list archives are your best bet for finding
known-working setups.
Given two different Back UPS 1400 Pro's that look identical (same
connectors, etc), would it be possible that one only supports dumb and
one supports both? E.g., that it might be necessary to check the
serial number of something?
Assuming your UPS has a 9 pin serial connector (and not a USB jack or an
Yes, they're all DB9.
RJ45-10 jack), this cable is likely to have the best chance of working.
OK. Problem is I have no easy way of checking w/o buying one (or several).
Post by f***@media.mit.edu
Will apcupsd -only- try to use ASCII to talk to the UPS, or will it
assume it's got the "dumb" control lines 'cause it's a Back-UPS Pro?
Apcupsd will obey your UPSTYPE setting in apcupsd.conf.
Ah, ok.
Possibly. But it might get over it. If you're going to build your own
cable, I'd suggest starting with the 95A diagram and wire only the SG,
TXD, RTS, and RXD lines. That would appear to be the minimal set to get
smart mode working on a Pro (assuming your particular Pro supports smart
mode at all). If it works, you're done. If not, keep adding stuff (and
also testing 'dumb' mode) until it does. I know, not a very reassuring
suggestion, but it's the best I have...
Err, uhm, RTS and TXD map to the SAME line (DCD) on the UPS side,
through that resistor/diode network; are you saying I've gotta build
that network as well, or that I can get away with just using TXD and
leaving RTS unconnected?

FWIW, I've currently got the device cabled through a serial-line
protocol analyzer that lets me patch any combination of wires to any
other combination and look at all the signals (both data and control).
But having to patch through a resistor/diode would be more painful.

(It's somewhat annoying in that the analyzer is a DB25 device, so I've
got DB9/25 adaptors on both ends and have to be constantly translating
pin numbers between the two standards as well, but oh well.)

Currently, I -think- I have the UPS wired correctly, but sending a Y
and then (after a few seconds) a ^Z at 2400/8N1 doesn't do anything.
[Should I be sending something else? Sending CR, LF, or CRLF
afterwards? Something else I'm missing?] I've also tried swapping
pins 2 and 3 at the DB25 end (e.g., computer end) because DB9 & 25
differ on which is TXD vs RXD; that doesn't appear to have helped,
either.

HOWEVER, if I disconnect ALL wiring to the UPS (even ground!---but the
UPS and my analyzer are on the same circuit) and then apply SPACE to
DB25 pin -4- (which corresponds to DB9 pin 7), the UPS shuts down.
This seems to imply simple signalling. (But the 940-0095A cable
implies that shutdown is DB25 pin -8- (e.g., DB9 pin 1), not DB25 pin
4 (which is pin 7). WTF? (Putting MARK or SPACE on DB9 pin 8 [DB25
pin 5) seems to do nothing.) Yet neither the diagram in the apcupsd
manual, or in the URL I mentioned in my first message, even comment at
all on DB9 pin 7 -on the UPS side-. (Both diagrams mention DB9 pin 7
on the computer side, but that's different.)

Finally, note http://www.apc.com/support/faq.cfm; it claims that 0095A
should work with "both" types of Back-UPS Pro (the PNP or the S), but
that there are two different alternate cables for those two types.
However, I don't see any way of figuring out which kind of Pro I have;
none of them say PNP or S on them anywhere, and the model-number
barcode doesn't even follow their format for some of them---it
doesn't start with "BP" but instead says "BACK UPS PRO 1400"
all spelled out. [I mean, I -guess- I could get the expensive
0095A's and just hope that they work for -all- Pros, and maybe
even that somehow magically they'll enable Smart signalling if
I have it, but...]

So NOW what?

(In part, I'm trying to decide whether to buy a 5-pack of 0095A's for
my 4 Pros [and, if I can, use the 4th for my SmartUPS, or get the
"correct" cable for it which I believe would be the 0024C). I need
to decide on the 5-pack in the next day or two.
Adam Kropelin
2007-07-29 13:16:32 UTC
Permalink
Post by Adam Kropelin
Post by Adam Kropelin
There are a variety of Pro models capable of communicating via
smart
Post by Adam Kropelin
serial, dumb serial, USB, and various combinations of the three.
I know
Given two different Back UPS 1400 Pro's that look identical (same
connectors, etc), would it be possible that one only supports dumb and
one supports both? E.g., that it might be necessary to check the
serial number of something?
It's possible, but unlikely. I think most of the protocol differences in
the Pro line happened over time and I suspect there would be a visual
clue.
Post by Adam Kropelin
Post by Adam Kropelin
Possibly. But it might get over it. If you're going to build your
own
Post by Adam Kropelin
cable, I'd suggest starting with the 95A diagram and wire only
the SG,
Post by Adam Kropelin
TXD, RTS, and RXD lines. That would appear to be the minimal set
to get
Post by Adam Kropelin
smart mode working on a Pro (assuming your particular Pro
supports smart
Err, uhm, RTS and TXD map to the SAME line (DCD) on the UPS side,
through that resistor/diode network; are you saying I've gotta build
that network as well, or that I can get away with just using TXD and
leaving RTS unconnected?
According to the (moldy old) code in apcupsd, RTS must be cleared in
order to enable smart mode:

/*
* The following enables communcations with the
* BackUPS Pro models in Smart Mode.
*/
switch (ups->cable.type) {
case APC_940_0095A:
case APC_940_0095B:
case APC_940_0095C:
/* Have to clear RTS line to access the serial cable mode PnP
*/
(void)ioctl(ups->fd, TIOCMBIC, &rts_bit);
break;

default:
break;
}

That may simply be to avoid interfering with data sent on TXD, but it
also may be a signal to the UPS to switch modes.
Post by Adam Kropelin
FWIW, I've currently got the device cabled through a serial-line
protocol analyzer that lets me patch any combination of wires to any
other combination and look at all the signals (both data and control).
But having to patch through a resistor/diode would be more painful.
True, but you're in a perfect position to experiment and figure this
out.
Post by Adam Kropelin
Currently, I -think- I have the UPS wired correctly, but sending a Y
and then (after a few seconds) a ^Z at 2400/8N1 doesn't do anything.
Sending "Y" should get you "SM" in response immediately if smart mode is
working.
Post by Adam Kropelin
[Should I be sending something else? Sending CR, LF, or CRLF
afterwards? Something else I'm missing?] I've also tried swapping
pins 2 and 3 at the DB25 end (e.g., computer end) because DB9 & 25
differ on which is TXD vs RXD; that doesn't appear to have helped,
either.
Make sure flow control is disabled on your serial line.
Post by Adam Kropelin
HOWEVER, if I disconnect ALL wiring to the UPS (even ground!---but the
UPS and my analyzer are on the same circuit) and then apply SPACE to
DB25 pin -4- (which corresponds to DB9 pin 7), the UPS shuts down.
This seems to imply simple signalling. (But the 940-0095A cable
implies that shutdown is DB25 pin -8- (e.g., DB9 pin 1), not DB25 pin
4 (which is pin 7). WTF? (Putting MARK or SPACE on DB9 pin 8 [DB25
pin 5) seems to do nothing.) Yet neither the diagram in the apcupsd
manual, or in the URL I mentioned in my first message, even comment at
all on DB9 pin 7 -on the UPS side-. (Both diagrams mention DB9 pin 7
on the computer side, but that's different.)
I don't follow any of that discussion due to the mixing of DB9 and DB25
pin numbers and UPS vs. PC ends of the cable. So I have no useful
comment on what you're observing.
Post by Adam Kropelin
Finally, note http://www.apc.com/support/faq.cfm; it claims that 0095A
should work with "both" types of Back-UPS Pro (the PNP or the S), but
that there are two different alternate cables for those two types.
However, I don't see any way of figuring out which kind of Pro I have;
none of them say PNP or S on them anywhere, and the model-number
barcode doesn't even follow their format for some of them---it
doesn't start with "BP" but instead says "BACK UPS PRO 1400"
all spelled out. [I mean, I -guess- I could get the expensive
0095A's and just hope that they work for -all- Pros, and maybe
even that somehow magically they'll enable Smart signalling if
I have it, but...]
For the price of a bog standard resistor, transistor, and diode from
Radio Shack you could try before you buy.
Post by Adam Kropelin
(In part, I'm trying to decide whether to buy a 5-pack of 0095A's for
my 4 Pros [and, if I can, use the 4th for my SmartUPS, or get the
"correct" cable for it which I believe would be the 0024C). I need
to decide on the 5-pack in the next day or two.
The 24C is even easier to test.

--Adam
f***@media.mit.edu
2007-07-29 02:56:12 UTC
Permalink
Date: Sat, 28 Jul 2007 22:22:10 -0400 (EDT)
HOWEVER, if I disconnect ALL wiring to the UPS (even ground!---but the
UPS and my analyzer are on the same circuit) and then apply SPACE to
DB25 pin -4- (which corresponds to DB9 pin 7), the UPS shuts down.
Hmm. And pulsing it again starts the UPS back up. This is claimed on
page 127 of the apcupsd manual to be "Turn on/off power (only on
advanced UPSes only)".

So the department of redundancy department believes that maybe my pin
7 behavior implies that I have an "advanced" UPS. So why can't I seem
to get it to speak when spoken to?
f***@media.mit.edu
2007-07-29 20:41:49 UTC
Permalink
Date: Sun, 29 Jul 2007 09:16:32 -0400
According to the (moldy old) code in apcupsd, RTS must be cleared in
/*
* The following enables communcations with the
* BackUPS Pro models in Smart Mode.
*/
switch (ups->cable.type) {
/* Have to clear RTS line to access the serial cable mode PnP */
(void)ioctl(ups->fd, TIOCMBIC, &rts_bit);
break;
break;
}
That may simply be to avoid interfering with data sent on TXD, but it
also may be a signal to the UPS to switch modes.
Hmm. I think it's just to avoid interference, because assuming that
"clear" = MARK = -12V, that diode will block a MARK on RTS from making
it through to the UPS, unless the schematic is drawn backwards.
Make sure flow control is disabled on your serial line.
Done, but also irrelevant 'cause the analyzer (which is sitting in the
middle between the UPS and the CPU) would see the traffic regardless.
I don't follow any of that discussion due to the mixing of DB9 and DB25
pin numbers and UPS vs. PC ends of the cable. So I have no useful
comment on what you're observing.
I'm saying that bringing pin 7 on the DB9 connected to the UPS to
SPACE causes the UPS to shut down. Doing so again causes it to start
up again. (It occasionally causes a running UPS to transition to
battery instead, so perhaps it's a three-state control and the flaky
behavior is because I'm seeing contact bounce---I'm just touching the
relevant wire to the relevant pin, so of course there'll be a pulse
train there and not a single sharp transition.) [And my followup
message said, ``This is claimed on page 127 of the apcupsd manual to
be "Turn on/off power (only on advanced UPSes only)".'']
For the price of a bog standard resistor, transistor, and diode from
Radio Shack you could try before you buy.
I've already got 'em, but I can't easily wire them up because the
analyzer only allows jumpering but not interposing my own components.
So I'm about to wire up a custom cable consisting of (at least) the
resistor & diode around RTS and see what happens; I probably have
something like the transistor around but hope not to have to go that
far. (And I was hoping to minimize the number of stray components and
consequent chances of a failure 'cause something came loose or I goofed,
but I guess I'll have to bite the bullet.)
The 24C is even easier to test.
That was essentially my first test (through the analyzer). No dice.
(I didn't bother with any of the CPU-side jumpering; I just connected
TX, RX, and GND and sent a "Y" at 2400/8N1 and saw no response.)

Loading...