At one point, the RS-232 9-pin Serial Port used to be a common connector on the back of every computer. But with USB being a much better protocol and easier to use, the serial port has just about disappeared from modern desktop computers. With servers, however, the serial port is still in use, but sometimes it’s only available as an IDC COM header connector on the motherboard. If you have a need for a serial port, then an IDC10-to-DB9 serial adapter might be required. I had just such a need recently and discovered that there are two industry standard pinout conventions in use, the AT/Everex and the DTK/Intel. If you want to know more about how I discovered this and the differences, then continue reading.
I’m in the process of building a server with Ubuntu 12.04, and I needed a serial connector to communicate with an APC Smart-UPS RT 1500VA RM. Although this UPS is capable of USB communication, APC uses a RJ45 connector on the back of the unit, and I didn’t own one the correct cable. I did, however, own one of their proprietary serial cables, part number 940-0024C, so that’s how I set things up.
Initially, I had communication problems as a result of purchasing the wrong IDC10-to-DB9 serial adapter. So before discovering and solving this problem, I setup the UPS with a Keyspan USA-19HS USB-to-serial adapter, which I thought would be an easy fix. This wasn’t the case, so let me explain.
I’m using apcupsd to monitor the UPS and control the server during a power outage. When using the Keyspan adapter, the only caveat is that communication with the UPS is configured as using a serial cable instead of a USB cable. This caused a bit of a problem for me. For a typical USB configuration, apcupsd.conf would be setup as follows. Note that UPSCABLE and UPSTYPE are configured as usb and DEVICE is not defined at all. This is because apcupsd will try all the known USB ports until it succeeds.
## apcupsd.conf v1.1 ## UPSCABLE usb UPSTYPE usb DEVICE
However, when using the Keyspan USB-to-serial adapter, apcupsd.conf needed to be configured differently. In the following configuration, notice that UPSCABLE and UPSTYPE are not configured as usb. Instead, I define UPSCABLE as the model number of the proprietary APC serial cable I’m using, 940-0024C, and UPSTYPE as smartups. I also explicitly define DEVICE as /dev/ttyUSB0.
## apcupsd.conf v1.1 ## UPSCABLE 940-0024C UPSTYPE smartups DEVICE /dev/ttyUSB0
The problem with this setup was that I couldn’t rely on the device always being ttyUSB0. The next time the server rebooted, it could have been ttyUSB1. This was unreliable, so I wanted to figure out what the problem was with my serial connection.
After a bit of research, I learned that there were two pinout conventions used for the IDC10 header on motherboards. They were known as AT/Everex and DTK/Intel. AT/Everex was known as Straight Through Wiring, and DTK/Intel ws known as Cross Over Wiring.
The following tables detail the differences:
|1||DCD||<----||Data Carrier Detect||1||1|
|4||DTR||---->||Data Terminal Ready||4||7|
|6||DSR||<----||Data Set Ready||6||2|
|7||RTS||---->||Request to Send||7||4|
|8||CTS||<----||Clear to Send||8||6|
Once I discovered that there were two industry standard conventions in use for the IDC COM header connector pinout, my problem was solved. A quick fix was to buy the correct adapter. Even quicker, I warmed up the soldering iron and re-wired my adapter in less than ten minutes. Finally, the server was powered through the UPS and accurately monitored via apcupsd. I’m a happy administrator.
And just to be complete, here was the final configuration settings I used in apcupsd.conf:
## apcupsd.conf v1.1 ## UPSCABLE 940-0024C UPSTYPE smartups DEVICE /dev/ttyS0
If you would like to learn more about RS-232, check out this Wikipedia page.
If you would like to buy the Keyspan USA-19HS USB-to-Serial adapter, you can get it at Amazon.