gentest(8) tests communication with UPS


/usr/sbin/gentest [ -d ] [ -r ] serial-device


Gentest monitors the serial port connected to a UPS and allows DTR and/or RTS lines to be stet to simulate the genpowerd UPS monitoring software.

The gentest program will show the state of the control lines in the serial connection. Its primary purpose is to help discover the settings for UPS monitoring cables.


Some serial port that is not being used by some other device, and does not share an interrupt with any other serial port.


gentest has the following command line options:
Causes gentest to assert DTR on the serial line.
Causes gentest to assert RTS on the serial line.


If we were to start gentest with the command line

genpower -r /dev/ttyS1

while /dev/ttyS1 was connected to a LAN Manager cable and a TrippLite BC750/LAN, gentest would display:

DTR = Cleared
RTS = Set
CAR = Low   ( )
CTS = Low   ( )
DSR = Low   ( )
RNG = Low   ( )

If the line power to the UPS were shut off, gentest would update the screen with:

DTR = Cleared
RTS = Set
CAR = Low   ( )
CTS = High  (*)
DSR = Low   ( )
RNG = Low   ( )

indicating that the CTS line had changed status and that the new status of the CTS line is HIGH.

Gentest is valuable in determining the parameters to use in genpowerd.h with unfamiliar cables and UPSs. In the example above, it could be determined that RTS probably provides power to the cable and that CTS is the line that shows changes in the line power's status (with LOW being the normal status of the line).


If your UPS supports an inverter shutdown, either RTS or DTR could be used to kill the inverter. Tests should not be performed if your system is using the UPS. Specifically, the use of the -r and -d options together is not recomended.


Gentest does not use environment variables.


None used.


None known.


Tom Webster <[email protected]> (for the program) Raphael Manfredi <[email protected]> (manpage only)