Introduction to terminal connection through serial ports in LINUX
Source: Internet
Author: User
Article title: Introduction of using a serial port to connect to a terminal in LINUX. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The serial direct connection cable is used for the direct connection between two computers. the two ends of the cable have a 9-pin plug and a 25-pin plug:
The first two figures are master-node top views.
9 pin definition:
Definition of the 25-pin Master pin (in this connection, only 8 pins work ):
Pin definition
When the connector is a 9-pin connector and a 25-pin connector, the line connection should be:
When both ends of the connection are a 9-pin mother plug, the line connection should be:
Note: NC indicates that the other end is connected by its own pins.
In addition, to ensure that the serial port can work properly physically, you can use the plug-in to test whether the port is normal:
Insert the plug-in to the serial port to be tested, and then follow the netterm settings below. after the connection, enter the characters in netterm. if the entered characters are displayed on the screen, the serial port is physically normal.
Port: COM1 (or COM2 depends on the port on which the connection line is connected)
Bit Rate (Baud Rate): 9600
Data Bits (Data bit): 8
Parity (Parity): None (None)
Stop Bits (Stop bit): 1
Maxium Connect (maximum waiting time during dial-up): in the control section of 60, only Direct Line is enabled (that is, check box is used with a check mark, and none of the other options are selected) do not modify other parameters by default.
II. how to set Mgetty in linux: First, install the Mgetty software package. on the Redhat CD, run the RPM package containing the software in the directory where the RPM Package is located:
Rpm-ivh mgetty-1.1.3-i386.rpm
You can.
The settings to be modified are as follows:
Add the following line to the inittab configuration file in the/etc/directory:
S0: 345: respawn:/sbin/mgetty-r-x 9 ttyS1
The last parameter, ttyS1, is determined based on the port on the linux machine you connect, if you connect to com1, you should change this parameter to ttyS0. if it is COM2, it should be ttyS1 and there is mgetty in the/etc/mgetty-sendfax directory. config file:
The content should be:
#
# Mgetty configuration file
#
# This is a sample configuration file, see mgetty.info for details
#
# Comment lines start with a "#", empty lines are ignored
# ----- Global section -----
#
# In this section, you put the global ULTS ults, per-port stuff is below
# Set the global debug level to "4" (default from policy. h)
Debug 9
# Access the modem (s) with 38400 bps
Speed9600
Port ttyS1
Direct yes
If you connect to the com1 port of the inux machine, you need
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.