Whole document tree
This section is just from messages I've seen on the net. I haven't done it so I can't write from experience. If anyone has, please write this section for me :). See also the message about the GPS1000 contained in section GPS1000 from ACCODATA, not to mention all the UPS specific data in section Info on selected UPSs.
>From firstname.lastname@example.org Wed Jul 21 14:26:33 1993 Newsgroups: comp.os.linux Subject: Re: UPS interface for Linux? From: email@example.com (Miquel van Smoorenburg) Date: Sat, 17 Jul 93 18:03:37 Distribution: world Organization: Cistron Electronics. In article <1993Jul15.firstname.lastname@example.org> email@example.com (Joel M. Hoffman) writes: >I'm in the process of buying a UPS (Uninteruptable Power Supply), and >notice that some of them have interfaces for LAN's to signal the LAN >when the power fails. > >Is there such an interface for Linux? > >Thanks. > >-Joel >(firstname.lastname@example.org) > When I worked on the last versioon of SysVinit (Now version 2.4), I temporarily had a UPS on my computer, so I added support for it. You might have seen that in the latest <signal.h> header files there is a #define SIGPWR 30 now :-). Anyway, I did not have such a special interface but the output of most UPS's is just a relais that makes or breaks on power interrupt. I thought up a simple way to connect this to the DCD line of the serial port. In the SysVinit package there is a daemon called 'powerd' that keeps an eye on that serial line and sends SIGPWR to init when the status changes, so that init can do something (such as bringing the system down within 5 minutes). How to connect the UPS to the serial line is described in the source "powerd.c", but I will draw it here for explanation: +------------------------o DTR | +---+ | | resistor | | 10 kilo-Ohm | | +---+ To serial port. | +-----o-------+------------------------o DCD | | o UPS | \ relais | \ | | | +-----o-------+------------------------o GND Nice drawing eh? Hope this helps. SysVinit can be found on sunsite (and tsx-11 probably) as SysVinit2.4.tar.z Mike. -- Miquel van Smoorenburg, <email@example.com> Ibmio.com: cannot open CONFIG.SYS: file handle broke off. >From firstname.lastname@example.org Wed Jul 21 14:27:04 1993 Newsgroups: comp.os.linux Subject: Re: UPS interface for Linux? From: email@example.com (Danny ter Haar) Date: Mon, 19 Jul 93 11:02:14 Distribution: world Organization: Cistron Electronics. In article <firstname.lastname@example.org> email@example.com (Miquel van Smoorenburg) writes: >How to connect the UPS to the serial line is described in the source >"powerd.c", but I will draw it here for explanation: The drawing wasn't really clear, please use this one in stead ! > > +------------------------o DTR > | > +---+ > | | resistor > | | 10 kilo-Ohm > | | > +---+ To serial port. > | > +-----o-------+------------------------o DCD > | > o UPS > \ relais > \ > | > +-----o--------------------------------o GND > The DTR is kept high, when the UPS's power input is gone it will close the relais . The computer is monitoring the DCD input port to go LOW . When this happens it will start a shutdown sequence... _____ Danny -- <=====================================================================> Danny ter Haar <firstname.lastname@example.org> or <email@example.com> Robins law #103: 'a couple of lightyears can't part good friends'
Try to get documentation for the cables that your UPS seller supplies. In particular find out:
You then need to either hack
If you have trouble getting the above information, or just want to
check it (a good idea) the following program might help. It's a
hacked version of
Here's the (untested) upscheck.c program. It's untested because I edited the version I originally used to make it clearer, and can't test the new version at the moment.
The previous section presupposes knowledge of the correspondence between terminal signals and serial port pins. Here's a reference for that correspondence, taken from David Tal's ``Frequently Used Cables and Connectors'' document. I'm including a diagram illustrating the connectors, and a table listing the correspondence between pin numbers and terminal line signals.
If you need a general reference for cable wiring, connectors, etc, then David Tal's would be a good one, but I can't seem to locate this document on the net any more. But I've found a good replacement. It's The Hardware Book.
Other useful sites:
Incidentally, it seems that the Linuxdoc-sgml package still doesn't
format tables very well in the
1 13 1 5 _______________________________ _______________ \ . . . . . . . . . . . . . / \ . . . . . / RS232-connectors \ . . . . . . . . . . . . / \ . . . . / seen from outside --------------------------- ----------- of computer. 14 25 6 9 DTE : Data Terminal Equipment (i.e. computer) DCE : Data Communications Equipment (i.e. modem) RxD : Data received; 1 is transmitted "low", 0 as "high" TxD : Data sent; 1 is transmitted "low", 0 as "high" DTR : DTE announces that it is powered up and ready to communicate DSR : DCE announces that it is ready to communicate; low=modem hangup RTS : DTE asks DCE for permission to send data CTS : DCE agrees on RTS RI : DCE signals the DTE that an establishment of a connection is attempted DCD : DCE announces that a connection is established
Since you also might need to modify
Note that the 3rd column is in Hex.
Next Previous Contents