APC Smart-UPS

From TheBeard Science Project Wiki
Revision as of 22:34, 27 July 2020 by Beard (talk | contribs) (Configuring Apcupsd)

Jump to: navigation, search

The following information applies to all APC Smart-UPS models. Most of this I personally tested using a Smart-UPS SC 1500 and a Smart-UPS 2200 (both are rack mount units).

Console Cables

To configure a Smart-UPS, you need to connect via console cable. Depending on your model, the unit may have a USB port, serial port, or both.

USB to RJ50 Cable

The Smart-UPS uses a non-standard USB to RJ50 cable, which looks similar to an RJ45 but has 10 pins instead of 8. You might need to order a cable directly from APC or find a used one. The model number I ordered was AP9827 940-0127E and I can confirm it works on both Smart-UPS SC 1500 and 2200.

AP9827 940-0127E.jpg

If you happen to have an RJ50 connector and a spare USB cable, you could make your own with the following pinout:

APC USB Pinout.jpg

Serial Cable

IMPORTANT: You CANNOT connect a normal serial cable to the Smart-UPS. If you do connect a normal serial cable and terminate both ends, the Smart-UPS will likely shut down or exhibit other strange behaviors.

The cable required for a serial port on a Smart-UPS is also proprietary and has a non-standard pinout. You need a "Smart Signalling" capable serial cable (RS-232). The model number I ordered was 940-1524C and I can confirm it works with the Smart-UPS SC 1500 and 2200. Note that the "15" in that model number is the length of the cable, so any model that varies in those digits will work the same.

If you want to create your own serial cable, you will need a male DB9 connector and a female DB9 connector. Wire them up with the following pinout:

APC Serial Pinout.jpg

Monitoring Using PowerChute (Windows)

Monitoring Using Apcupsd (Linux)

Apcupsd is an open source alternative to APC's PowerChute software for monitoring and configuring APC UPS devices. You can install it using you package manager. Note: The following tutorials were performed on Debian-based Linux.

sudo apt-get install apcupsd

Finding Your Serial Port

Before you can configure apcupsd, you will need to figure out what serial port you're connected to. This is easy if you have only one serial device. The device file will be named something like /dev/ttySN where N is a number. Most likely you will have many serial ttys in the /dev directory, but most of them will not actually have a recognized UART device attached.

To find which serial devices have a UART, you can run to following command:

sudo less /proc/tty/driver/serial

You will see an output similar this:

0: uart:16550A port:000003F8 irq:4 tx:0 rx:0
1: uart:unknown port:000002F8 irq:3
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3
4: uart:ST16650V2 port:0000E030 irq:16 tx:0 rx:0
5: uart:ST16650V2 port:0000E020 irq:17 tx:121720 rx:670672 brk:4
6: uart:unknown port:00000000 irq:0
...

Ignore the ones that say "unknown." The ones that actually have a UART device will display the UART model. If you have more than one, you might need to use a process of elimination. I happen to know that my device is on line 5. The number on the far left corresponds to the device number N in the file name /dev/ttySN. So I will configure apcupsd to use the device /dev/ttyS5. If you're not sure which device is the right one, you can go ahead and continue Configuring Apcupsd as I've specified in the following steps, and then follow the steps in Reading UPS Status to figure out if you've chosen the right device number.

Configuring Apcupsd

Before you start the apcupsd service, there are a couple files you need to edit.

Edit the file /etc/apcupsd/apcupsd.conf and change the following lines to fit your needs:

UPSCABLE usb
UPSTYPE usb
DEVICE /dev/ttyS0

The file contains comments that very thoroughly explains what parameters are available for each option.

If you're using a serial cable, the UPSCABLE option needs to have the right model and UPSTYPE should be "apcsmart".

Here are my settings for serial:

UPSCABLE 940-1524C
UPSTYPE apcsmart
DEVICE /dev/ttyS5

Now you need to edit the file /etc/default/apcupsd.

Set the value to "yes":

ISCONFIGURED=yes

You are now ready to start the apcupsd service.

Starting/Stopping Apcupsd

Start apcupsd:

sudo systemctl start apcupsd

Stop apcupsd:

sudo systemctl stop apcupsd

Reading UPS Status

Once you have apcupsd configures and running, you can get a readout of information about the UPS by running the command:

sudo apcaccess

Accessing UPS Configuration Terminal

Calibration

Line Input Sensitivity

Shutdown Scripts

Converting a 2-Battery UPS to a 4-Battery UPS

Links And Files