Several months ago I posted some information on the cable to connect a Compaq T2400h to a standard serial port. This weekend I finally got around to trying out the information that I found. I now have the 2.4KVA UPS at the bottom of my rack cabinet talking to my Ubuntu-based fileserver, boron.
The first step was to create the cable. This requires a 9 pin female ‘D’ connector and a matching male connector. For the cable I used an offcut of CAT5, though normally serial cables do not use twisted pair (usually just parallel wires).
The software part is done using NUT, for which there is a package included in the Ubuntu distribution. This software talks to the UPS, monitors it’s status and allows other computers to check the status. The monitoring applications are then responsible for shutting down the computers attached to the UPS should power fail and the battery become critical. So far this is just boron and my Windows machine, aluminium. The latter uses WinNUT to shut down Windows when needed.
There were a few problems getting NUT to work with Ubuntu. First off, the package doesnt put any configuration files in the /etc/nut path, so I had to go hunt for the examples and copy then modify them. The next problem was with permissions for the serial port. For testing purposes I tried running the protocol module as root, but this introduced different permissions problems. The solution was to add the ‘nut’ user to the ‘dialout’ group, which is one group that has access to the serial ports. To my relief this got everything working.
These are the parameters that I can access over the serial connection:
simon@boron:~$ upsc compaq@boron
battery.charge: 97.22
battery.runtime: 1620.000
battery.voltage: 0055.50
battery.voltage.nominal: 0048.00
driver.name: upscode2
driver.parameter.input_timeout: 5
driver.parameter.manufacturer: Compaq
driver.parameter.port: /dev/ttyS0
driver.parameter.use_pre_lf: yes
driver.version: 2.0.5
driver.version.internal: 0.84
input.voltage: 0244.50
input.voltage.maximum: 0276.00
input.voltage.minimim: 0162.00
input.voltage.nominal: 0230.00
output.current: 0001.95
output.frequency: 0050.00
output.voltage: 0215.10
ups.alarm:
ups.delay.reboot: 000
ups.delay.shutdown: 000
ups.load: 21.875
ups.mfr: Compaq
ups.model: UPS 2400 VA FW -0023
ups.power.nominal: 2300.000
ups.serial: E########
ups.status: OL TRIM
These are the resources that I used to get the UPS/NUT combo working: