Multiport boards allow many terminals (or modems) to be connected to one PC computer. A terminal may be connected to its host computer either by a direct cable connection, via a modem, or via a terminal server.
Additional serial cards may be purchased which have many serial ports on them called "multiport boards". These boards are not covered in this HOWTO but there is quite a lot of coverage in the Serial-HOWTO One company which had (in 1998) below average prices is ByteRunner.
The simplest way to connect a terminal to a host computer is via a direct connection to a serial port on the computer. You may also use some the info in this section for connecting one computer to another (via the serial port). Most PC's come with a couple of serial ports, but one is usually used by a mouse. For the EIA-232 port, you need a null modem cable that crosses over the transmit and receive wires. If you want hardware flow control, you will probably use the DTR pin (or both the DTR and DSR pins).
Make sure you have the right kind of cable. A null modem cable bought at a computer store may do it (if it's long enough), but it probably will not work for hardware flow control. Such a cable may be labeled as a serial printer cable. See this to help determine if you should Buy or Make your own cable. Make sure you are connecting to your PC's serial port at the male DB25 or the DB9, and not your parallel port (female DB25).
These 3 diagrams are for real text-terminals. But you could use them to connect up 2 PCs if you substitute RTS for DTR and CTS for DSR. (Don't use 4-conductors for PC-to-PC). For terminals, if you only have DTR flow control (one-way) you may eliminate the RTS-to-DSR wire. If you have no hardware flow control, then you may also eliminate the CTS-to-DTR wire. Then if you have 2@ twisted pairs, you may then use 2 wires for signal ground per A Kludge using Twisted-Pair Cable. For a DB25 connector on your PC, you need:
PC male DB25 Terminal DB25
TxD Transmit Data 2 --> 3 RxD Receive Data
RxD Receive Data 3 <-- 2 TxD Transmit Data
SG Signal Ground 7 --- 7 SG Signal Ground
CTS Clear To Send 5 <--20 DTR Data Terminal Ready
RTS Request To Send 4 --> 6 DSR Data Set Ready
If you have a DB9 connector on your PC, try the following:
PC DB9 Terminal DB25
RxD Receive Data 2 <-- 2 TxD Transmit Data
TxD Transmit Data 3 --> 3 RxD Receive Data
SG Signal Ground 5 --- 7 SG Signal Ground
CTS Clear To Send 8 <--20 DTR Data Terminal Ready
RTS Request To Send 7 --> 6 DSR Data Set Ready **
If you have a DB9 connector on both your serial port and terminal:
PC DB9 Terminal DB9
RxD Receive Data 2 <-- 3 TxD Transmit Data
TxD Transmit Data 3 --> 2 RxD Receive Data
SG Signal Ground 5 --- 5 SG Signal Ground
CTS Clear To Send 8 <-- 4 DTR Data Terminal Ready
RTS Request To Send 7 --> 6 DSR Data Set Ready **
The above don't have modem control lines so be sure to give a "local" option to getty (which is equivalent to "stty clocal"). Also if you need hardware flow control it must be enabled at your computer (use a -h flag with agetty) ( equivalent to "stty crtscts" ).
The following 3 diagrams show full "standard" null modem cables. One that you purchase is apt to be wired this way. They will work fine for computer-to-computer connections. They also work for real terminals using software (Xon/Xoff) flow control (or no flow control). However, they don't work for terminal hardware flow control since most real terminals support DTR or DTR/DSR flow control (handshaking) but Linux doesn't.
PC male DB25 Terminal DB25
TxD Transmit Data 2 --> 3 RxD Receive Data
RxD Receive Data 3 <-- 2 TxD Transmit Data
RTS Request To Send 4 --> 5 CTS Clear To Send
CTS Clear To Send 5 <-- 4 RTS Request To Send
DSR Data Set Ready 6
|
DCD Carrier Detect 8 <-- 20 DTR Data Terminal Ready
SG Signal Ground 7 --- 7 SG Signal Ground
6 DSR Data Set Ready
|
DTR Data Terminal Ready 20 --> 8 DCD Carrier Detect
Alternatively, a full DB9-DB25 null modem cable (will not work
with terminal hardware handshaking; see above):
PC DB9 Terminal DB25
RxD Receive Data 2 <-- 2 TxD Transmit Data
TxD Transmit Data 3 --> 3 RxD Receive Data
6 DSR Data Set Ready
|
DTR Data Terminal Ready 4 --> 8 DCD Carrier Detect
GND Signal Ground 5 --- 7 GND Signal Ground
DCD Carrier Detect 1
|
DSR Data Set Ready 6 <-- 20 DTR Data Terminal Ready
RTS Request To Send 7 --> 5 CTS Clear To Send
CTS Clear To Send 8 <-- 4 RTS Request To Send
(RI Ring Indicator 9 not needed)
(Yes, the pins 2 and 3 really do have the opposite meanings in
DB9 connectors than in DB25 connectors!)
Here's how to null-modem connect two DB9's together (but DTR flow control will not work):
PC DB9 DB9
RxD Receive Data 2 <-- 3 TxD Transmit Data
TxD Transmit Data 3 --> 2 RxD Receive Data
6 DSR Data Set Ready
|
DTR Data Terminal Ready 4 --> 1 DCD Carrier Detect
GND Signal Ground 5 --- 5 GND Signal Ground
DCD Carrier Detect 1
|
DSR Data Set Ready 6 <-- 4 DTR Data Terminal Ready
RTS Request To Send 7 --> 8 CTS Clear To Send
CTS Clear To Send 8 <-- 7 RTS Request To Send
RI Ring Indicator 9 (not used)
Using the above 2 connections provide full modem control signals and seemingly allow one to set "stty -clocal". Then one must turn on the terminal first (asserts DTR) before the port may be opened in a normal manner by getty, etc. But there is likely to be trouble if you fail to turn on the terminal first (see Getty Respawning Too Rapidly). For this reason one should use "stty clocal" which is the default (ignores modem control lines) and the additional wires in these cables then serve no useful purpose.
In olden days when it may not have been this easy to ignore modem control signals etc, the following "trick" was done for cables that lacked conductors for modem control: on your computer side of the connector, connect RTS and CTS together, and also connect DSR, DCD and DTR together. This way, when the computer needs a certain handshaking signal to proceed, it will get it (falsely) from itself.
A cable longer than a 50 feet or so may not work properly at high speed. Much longer lengths sometimes work OK, especially if the speed is low and/or the cable is a special low-capacitance type and/or the electronics of the receiving end are extra sensitive. It is claimed that under ideal conditions at 9600 baud, 1000 feet works OK. One way to cover long distances is to install 2@ line drivers near each serial port so as to convert unbalanced to balanced (and conversely) and then use twisted pair cabling. But line drivers are expensive.
If you expect to use hardware flow control (handshaking) you will likely need to make up your own cable (or order one made). Of course, if the connecters on the ends of a used cable remove, you might rewire it. See Installing DB Connectors. You will need to determine whether or not the terminal uses the DTR pin for this, and if not, what pin (or pins) it uses. The set-up menus may give you a clue on this since there may be an option for enabling "DTR handshaking" (or flow control) which of course implies that it uses the DTR pin. It may also use the DSR pin. See Hardware Flow Control for a detailed explanation of it. Older terminals may have no provision for hardware flow control.
The normal "straight thru" cable will not work unless you are using it as an extension cable in conjunction with either a null modem cable or a null modem adapter. Make sure that the connectors on the cable ends will mate with the connectors on the hardware. One may use telephone cable which is at least 4-conductor (and possibly twisted pair). Shielded, special low-capacitance cable computer cable is best.
Although none of the EIA-232 signals are balanced for twisted pair one may attempt to use twisted-pair cable with it. Use one pair for transmit and another for receive. To do this connect signal ground to one wire in each of these 2 pair. Only part of the signal ground current flows in the desired wire but it may help. Due to the lower inductance of the twisted pair circuit (as compared to ground return current by some other path) more return (ground) current will confine itself to the desired twisted pair than one would expect from only resistance calculations. This is especially true at higher frequencies since inductive impedance increases with frequency. The rectangular wave of the serial port contains high frequency harmonics.
Pin 1 (of a DB25) should be chassis ground (also earth ground) but on cheap serial ports it may not even be connected to anything. A 9-pin connector doesn't even have a chassis ground. The signal ground is pin 7 and is usually grounded to chassis ground. This means that part of the signal current will flow thru the ground wires of the building wiring (undesirable). Cable shields are supposed to be only grounded at one end of the cable, but it may be better to ground both ends since it's better to have current in the shield than in the building wiring ??
Using a terminal-modem combination (without a computer) one may connect to BBS's. Some BBS's (such a free-nets) permit Internet access via the text browser lynx which will work on text terminals. Thus with an old terminal and external modem, one may connect to the Internet. If one connects to a host computer on which one has an account, then one may sometimes store ones work (or downloads) there.
Instead of connecting a terminal (or computer emulating a terminal) directly to a host computer using a cable it may be connected to the host via a telephone line (or dedicated private line) with a modem at each end of the line. The terminal (or computer) will usually dial out on a phone line to a host computer.
Most people use a PC and modem for dialing out. The PC could have a terminal connected to a serial port and the person at the terminal may dial out using the PC. Connecting a real terminal directly to an external modem is more difficult since the real terminal isn't very intelligent and doesn't give as much feedback to the user. For dialing out, many terminals can store one or more telephone numbers as messages which may be "set-up" into them and are sent out to the modem by pressing certain function keys. Many modems can also store phone numbers. The modem initiation sequence must precede the telephone number. When the outgoing call is answered by another modem at the other end of the phone line, the the host computer on this modem may run a getty program to enable you to log in.
It's common for a computer running Linux to get dialed into. The caller gets a login prompt and logs in. At first glance, it may seem strange how a dumb terminal (not connected to any computer) could accept an incoming call, but it can. One possible reason for doing this is to save on phone bills where rates are not symmetric. Your terminal needs to be set up for dial-in: Set the modem at your terminal for automatic answer (Register S0 set to 2 will answer on the 2nd ring). You turn on the terminal and modem before you expect a call and when the call comes in you get a login prompt and log in.
The host computer that dials out to your terminal needs to do something quite unusual. As soon as your modem answers, it needs to run login (getty). A host may do this by running the Linux program "callback" sometimes named "cb". Callback is for having computer A call computer B, and then B hangs up and calls A back. This is what you want if you are using computer A to emulate a terminal. For the case of a real terminal this may be too complex a task so the host may utilize only the "back" part of the callback program. The setup file for callback must be properly configured at the host. Callback makes the call to the terminal and then has mgetty run a login on that port. Mgetty by itself (as of early 1998) is only for dial-in calls but there is work being done to incorporate callback features into it and thus make it able to dial-out. As of early 1999 it didn't seem to have been done.
One use for terminal servers is to connect many terminals (or modems) to a high speed network which connects to host computers. Of course the terminal server must have the computing power and software to run network protocols so it is in some ways like a computer. The terminal server may interact with the user and ask what computer to connect to, etc. or it may connect without asking. One may sometimes send jobs to a printer thru a terminal server.
A PC today has enough computing power to act like a terminal server for text terminals except that each serial port should have its own hardware interrupt. PC's only have a few spare interrupts for this purpose and since they are hard-wired you can't create more by software. A solution is to use an advanced multiport serial card which has its own system of interrupts (or on lower cost models, shares one of the PC's interrupts between a number of ports). See Serial-HOWTO for more info about such cards. If such a PC runs Linux with getty running on many serial ports it might be thought of as a terminal server. It is in effect a terminal server if it is linked to other PC's over a network and if its job is mainly to pass thru data and handle the serial port interrupts every 14 (or so) bytes. Software called "radius" is sometimes used.
Terminal servers evolved to serve more than just terminals. They also serve PC's which emulate terminals, and were sometimes connected to a bank of modems connected to phone lines. With the advent of 56k digital modems that require a digital connection to service an incoming phone call, a digital interface to the telephone company was needed. This (and more) is provided today by "remote access servers" which have replaced the terminal server. Instead of many individual telephone line cables connected to a terminal server, one now finds just a few cables with many digitized telephone calls on a each cable (multiplexed). The multitude of connectors needed for large numbers of terminals or modems is no longer present on a remote access server and thus the successor to the terminal server can't readily serve text-terminals anymore.
A connector is more-or-less permanently attached to the end of a cable or to a hardware unit. There are two basic types of connectors used in serial communications: 1. DBxx with pins (such as DB25) and 2. modular telephone-style connectors.
An adapter looks about like a connector but it has two ends. It is just like a cable that is so short that there is no cable part left at all --just different connectors on each end is all that remains. The adapter just plugs in on each side. It allows two incompatible connectors to mate with each other by going in between them. Sometimes the purpose of the adapter is to interchange wires. Obviously, one may use a special cable (perhaps homemade) as a substitute for an adapter.
Connectors (or one side of adapters) are either male or female. The connectors that have pins are male and the ones that have sockets (sometimes also called pins) are female. For modular connectors, the ones with exposed contacts are plugs while the ones with internal contacts (not easy to see) are jacks. Plugs are male; jacks are female.
There are three basic types of adapters: null modem, gender changers and port adapters. Some adapters perform more than one of these three functions.
(For how to install a DB connector on the ends of a cable see Installing DB Connectors.) These come in 9 or 25 pins. The EIA-232 specs. call for 25 pins but since most of these pins are not used on ordinary serial ports, 9 pins is sufficient. See DB9-DB25 for the pin-out. The pins are usually numbered if you look closely enough or use a magnifying glass.
These look like modern telephone connectors but are sometimes not compatible with telephone connectors. See also Installing RJ Connectors. They may be 6, 8, or 10 conductor. RJ11/14 is a 4-6 conductor telephone plug. A look-alike is a MMJ connector (6-conductor) used on later model VT (and other) terminals. MMJ has an offset tab and is not compatible with RJ11/14. However, some connectors have been made that are compatible with both MMJ or RJ11/14. The MMJ pin-out is: 1-DTR, 2-TXD, 3-TXD GND, 4-RXD GND, 5-RXD, 6-DSR.
A null-modem cable with MMJ (or RJ11/14) connectors will connect: 1-6, 2-5, and 3-4. Note that such a cable support DTR/DSR flow control which is not supported (yet) by Linux. Making up your own 6-conductor null-modem cable is very simple if you understand that the ordinary 4-conductor telephone cable from the wall to your telephone, used in hundreds of millions of homes, is also a null-modem cable. Find one and wire your cable the same way.
If you lay such a cable (or your terminal null-modem cable) flat on the floor (with no twists) you will note that both plugs on the ends have their gold contacts facing up (or both facing down). Although it's symmetrical, it is also null- modem if you think about it a bit. One may put a few such cables together with inline couplers and everything works OK because each inline coupler is also a null-modem adapter. Two null-modem devices in series result in a straight-thru connection.
RJ45 and RJ48 are 8-conductor (or 10-conductor for some computer applications) telephone plugs. The 10-conductor ones are allegedly wider and will not mate with 8-conductor ones. They are used for both flat telephone cable and round twisted pair cable. The cable end of the connector may be different for round and flat cable and both RJ45 and RJ48 may be 8 or 10 conductor so make sure you get the right one. RJ48 has an extra tab so that a RJ48 plug will not push into a RJ45 jack (but a RJ45 plug will mate with a RJ48 jack). They're used on some multiport serial cards and networks. Heres the pin numbers for an 8-conductor:
Plug Jack
(Looking at the end (Looking at the cavity
end of a cable) in a wall)
.__________. .__________.
| 87654321 | | 12345678 |
|__. .__| |__. .__|
|____| |____|
You may try to buy a short, null modem cable. They are often labeled as serial printer cables (but serial printers are not very popular today and neither are the cables). Unfortunately, they will probably not work for hardware flow control. Make sure the connectors on the cable ends will fit the connectors on your computer and terminal.
But if you need longer cables to connect up terminals or need hardware flow control, how do you get the right cables? The right ready-made cables may be difficult to find (you might find them by searching the Internet), especially if you want to use a minimum (say 4) of conductors. One option is to get them custom made, which is likely to be fairly expensive although you might find someone to make them at prices not too much higher than ready-made cable (I did). Another alternative is to make your own. This may require special tools. If you can find it, used cable can be a real bargain but you will probably need to rewire the connectors. Most connectors that come with short cables are permanently molded to the cable and can't be rewired but most custom-made and homemade cables have connectors that can be rewired. One advantage of making your own cable is that the skills you learn will come in handy if a cable breaks (or goes bad) or if you need to make up another cable in a hurry.
The numbers of the pins should be engraved in the plastic of the connector. Each pin should have a number next to it. You may need a magnifying glass to read them.
See DB Connectors for a brief description of them. Unfortunately, most cables one purchases today have molded connectors on each end and can't be modified. Others have connectors which unscrew and can be rewired. If you are making up cable or modifying an existing one then you need to know about pins. There are two types: soldered and crimped.
The crimped pins require a special crimping tool and also need an "insertion/extraction" tool. But once you have these tools, making up and modifying cable may be faster than soldering. If you are connecting two wires to one pin (also needed if you want to jumper one connected pin to another pin) then soldering is faster (for these pins). This is because the crimped pins can only take one wire each while the soldered ones can accept more than one wire per pin.
To insert crimped pins just push them in by hand or with the tool. Removing a pin with the tool is a little tricky. These directions can be best understood if you have both the tool and wires in front of you. You must put the tool tip around a wire at the the back of a pin and insert it as far as it will go into the hole (about 1 1/2 cm.). Some tools have a mark (such as a tiny hole) on them to indicate how far to insert it. The tool tip should have a tapered gap so that you may get the tip around the wire by starting it in where the gap is wider than the wire. The tool may have 2 tips. The one that is the most difficult to get around the wire is also the one that removes the wire the easiest since it almost completely envelops the wire.
With the tip properly inserted pull on both the tool and the wire with a gentle pull. If it doesn't come out, the tool was likely not inserted correctly so either push it in more or twist it to a different position (or both). Perhaps you should have used the other tip that goes more around the pin. Using this tool, one may readily convert a straight-thru cable to a null-modem cable, etc.
There can be problems using the "insertion/extraction" tool. If the tools will not insert on the back of the pin, it could be that the pin was not neatly crimped to the wire and is sort of square where it should be round, etc. If a pin starts to come out but will not pull out all the way, the pin may be bent. Look at it under a magnifying glass. Straightening a pin with needle-nose pliers may damage the gold plating. Sometimes a stuck pin may be pushed out with a thick screwdriver blade tip (or the like) but if you push too hard you may gouge the plastic hole or bend the pin:.
Don't try soldering unless you know what you're doing or have read about how to do it.
These are telephone modular connecters one type of which is used for most ordinary telephones. But there are many different types (see RJ Modular Connectors).
These are not easy to reuse. You might be able to pull the wires out, push in something wedged that would lift up the gold-colored contacts and reuse the connector. There are special crimping tools used to install them; a different tool for each type.
If you don't have a crimping tool, installation is still possible (but difficult) using a small screwdriver (and possibly a hammer). Push in the cable wires and then push each gold-colored contact down hard with a small screwdriver that will just fit between the insulating ridges between the contacts. You may damage it if you fail to use a screwdriver with a head almost the same thickness as the contacts or if the screwdriver slips off the contact as you are pushing it down. You may also use a small hammer to pound on the screwdriver (push first by hand).
Be sure to not hurt the "remove lever" on the connecter when you push in the contacts. Don't just set it down on a table and push in the contacts. Instead, put a shim (about 1 mm thick) that fits snugly in the crevice between the lever and the body. For such a shim you may use thick cardboard, several calling cards, or wood. Since the bottom of the connector (that you will put on the table) isn't level (due to the "remove lever), make sure that the table top has something a little soft on it (like a sheet of cardboard) to help support the non-level connector. Even better would be to put another 1mm shim under the first 6mm of the connector, supporting it just under where you see the contacts. A soft tabletop wouldn't hurt either. Another method (I've never done this) is to hold the connector in a vice but be careful not to break the connector.
As compared to using a crimping tool, installing it per above takes a lot longer and is much more prone to errors and failure but it's sometimes more expedient and a lot cheaper than buying a special tool if you only have one or two connectors to install.