next up previous contents index
Next: Troubleshooting Serial Line communications Up: Apcupsd User's Guide Previous: Cables   Contents   Index

Subsections


Testing Serial-Line UPSes

If you have a serial-line UPS, there are some tests you should run before the general ones described in the Testing (see Testing Apcupsd) section.

To test your computer's connection with a serial-line UPS, you first need to establish that the serial line is functioning, and then that the UPS is responding to commands. This can be a bit tricky, especially with a dumb voltage-signalling interface, because it is completely quiescent when there are no commands being passed, and the command repertoire doesn't include any self-tests.

Because it is easy to configure a serial cable incorrectly in such a way as to cause premature shutdowns of the UPS power, we strongly recommend, especially for voltage- signaling (dumb) UPSes, that you do most of the initial testing with your computer plugged into the wall rather than your UPS. Thus if the UPS power is suddenly shut off, your computer will continue to run. We also recommend using safe-apccontrol as described below, until you are sure that the signaling is correct.

Also note that if you launch the execution of apcupsd while your voltage-signaling UPS is on battery power, it is very likely that your UPS will immediately shut off the power. This is due to the initialization of the serial port line signals, which often looks to the UPS like a shutdown command.

Finally, double-check the state of your cabling and UPS indicator lights frequently during testing. For voltage-signaling UPSes, apcupsd is not currently able to detect whether or not the serial cable is connected. In addition, some simple signaling UPSes with certain cable combinations are not able to detect the low battery condition. For more details please see Voltage Signalling Features Supported by Apcupsd for Various Cables.


Establishing Serial Port Connection

Once you have compiled, installed, and invoked apcupsd, you should wait to allow apcupsd to configure itself and establish contact with the UPS.

If you see the following message about 30 seconds after starting apcupsd:

     apcupsd FATAL ERROR in apcserial.c at line 156
     PANIC! Cannot communicate with UPS via serial port.

it means that apcupsd tried for about 30 seconds to establish contact with the UPS via the serial port, but was unable to do so. Before continuing, you must correct this problem. Some of the possible sources of the problem are:

The first thing to do is to look at your log file, usually /var/log/messages because apcupsd writes more detailed information to the log file whenever there is an error.

If you have a UPS that uses apcsmart protcol (see table of types (see type_table) for a list of the UPSes using these protocols), you can manually test the serial communications with the UPS by starting a serial port communications program (such as minicom, tip, or cu) with the settings 2400 8N1 (2400 baud, 8 bits, no parity, 1 stop bit). Be extremely careful what you send to your UPS as certain characters may cause it to power down or may even cause damage to the UPS. Try sending an upper case Y to the UPS (without a return at the end). It should respond with SM. If this is not the case, review the possible problems listed above. If you fat finger the Y and enter y instead, no cause for alarm, you will simply get the APC copyright notice.

Once you are sure that serial port communications is working, proceed to the next test.


Using apctest on Serial-Line UPSses

On an apcsmart serial-line UPS, apctest will give you access to the battery of low-level tests we described in apctest. If you have a voltage-signalling UPS, it enables a different test repertoire which is described here, Among other things, if you are uncertain about what kind of cable you have, you may be able to use apctest to figure that out.

Shutdown apcupsd if it is running. Make sure your /etc/apcupsd/apcupsd.conf file has UPSTYPE backups and UPSCABLE simple Normally apctest will have been built and installed by default, otherwise, you can explicitly build it on Unix with:

     cd <apcupsd-source-directory>
     make apctest
     ./apctest

on Win32 systems, use:

     make apctestwin32
     ./apctest

It will present you with the following output

     2001-02-07 04:08:26 apctest 3.8.5 (3 January 2002) redhat
     Checking configuration ...
     sharenet.type = DISABLE
     cable.type = CUSTOM_SIMPLE
     mode.type = BK
     Setting up serial port ...
     Creating serial port lock file ...
     Doing prep_serial() ...
     Hello, this is the apcupsd Cable Test program.
     This part of apctest is for testing dumb UPSes (ones that uses signaling rather than commands.
     Most tests enter a loop polling every second for 10 seconds.

Then it will present you with the following list of choices:

     1) Test 1 - normal mode
     2) Test 2 - no cable
     3) Test 3 - no power
     4) Test 4 - low battery (requires test 3 first)
     5) Test 5 - battery exhausted
     6) Test 6 - kill UPS power
     7) Test 7 - run tests 1 through 5
     8) Guess which is the appropriate cable
     9) quit
     
     Select test number:

Run tests 1, 2, and 3. Note, none of the currently supported cables will indicate a change for test 2. You can then run test 8 to see what cable it thinks you should be using. Finally run test 4.

apctest can also be run for Smart UPSes.

The print out of your testing will be written to the file apctest.output. If you are unable to solve your problem, you can try posting that file to the development mailing list, and perhaps we can help you. In this case, please also include information on your operating system, which version of apcupsd you are using, your UPS model, and also your apcupsd.conf file.

Expected apctest Signals for a UPS:

If you have configured your UPS as:

     UPSTYPE backups
     UPSCABLE APC_940_0119A
         or APC_940_0127A
         or APC_940_0128A
         or APC_940_0020B
         or APC_940_0020C

here are typical signals you would expect to see in the output from the various tests of apctest:

     Test 1 normal:              RTS for cables (0119A 0127A 0128A)
     Test 2 no serial cable:     not important
     Test 3 no AC power:         CTS for all cables
     Test 4 batteries exhausted: CTS and CD for all cables

Note: RTS if set in Test 1 will probably also be set in all the other tests. This is not important, what counts is the appearance of CTS when the power fails and additionally CD when the batteries are low.

Expected apctest Signals for a BackUPS Pro:

If you have configured your UPS as:

     UPSTYPE backupspro
     UPSCABLE APC_940_0095A
         or APC_940_0095C

here are the typical signals you would expect to see in the output from the various tests of apctest:

     Test 1 normal:              RTS not set
     Test 2 no serial cable:     not important
     Test 3 no AC power:         RNG
     Test 4 batteries exhausted: RNG and CD

Note: RTS should never be set in any of the tests as it is the killpower signal. What is important is the appearance of RNG when the power fails and additionally CD when the batteries are low.


next up previous contents index
Next: Troubleshooting Serial Line communications Up: Apcupsd User's Guide Previous: Cables   Contents   Index
2009-03-11