在Linux下用minicom管理串口设备

用Linux下的minicom程序,操作如下:
1)先检查系统是否安装了minicom,如没有安装请先安装,安装方法略。
   #rpm -qa |grep minicom
    minicom-2.00.0-17.1

2)对minicon进行参数设置
  以root用户登录linux系统,后执行:
   #minicom -s
  回出现一个配置界面:
┌─────[configuration]──────┐
│ Filenames and paths
│ File transfer protocols
│ Serial port setup
│ Modem and dialing
│ Screen and keyboard
│ Save setup as dfl
│ Save setup as..
│ Exit
│ Exit from Minicom
└─────────── ────────┘
  选serial port setup,将 “E -Bps/Par/Bits”设置成“9600 8N1”,同时可以指定com接口,其中/dev/ttyS0代表com1,/dev/ttyS1为com2......。如下图:
┌────────────────────────────────┐
│ A -    Serial Device      : /dev/ttyS1
│ B - Lockfile Location     : /var/lock
│ C -   Callin Program      :
│ D -  Callout Program      :
│ E -    Bps/Par/Bits       : 9600 8N1
│ F - Hardware Flow Control : Yes
│ G - Software Flow Control : No
│                              
│    Change which setting?      
└────────────────────────────────┘


接下来修改“Modem and dialing”的参数,将A -init string和B-reset string设为空,按回车确认,如下:

┌───[Modem and dialing parameter setup]─────────────┐
│                                          
│ A - Init ........                
│ B - Reset .......                              
│ C - Dialing prefix #1.... ATDT       
│ D - Dialing suffix #1.... ^M                    
│ E - Dialing prefix #2.... ATDP                
│ F - Dialing suffix #2.... ^M                 
│ G - Dialing prefix #3.... ATX1DT                 
│ H - Dialing suffix #3.... ;X4D^M                 
│ I - Connect string ...... CONNECT                
│ J - No connect strings .. NO CARRIER    BUSY      
│                           NO DIALTONE   VOICE 
│ K - Hang-up string ...... ~~+++~~ATH^M            
│ L - Dial cancel string .. ^M                        
│                                                            
│ M - Dial time ........ 45      Q - Auto bps detect ..... No
│ N - Delay before redial . 2    R - Modem has DCD line .. Yes
│ O - Number of tries .. 10   S - Status line shows ..DTE speed
│ P - DTR drop time (0=no). 1      T - Multi-line untag .... No
│                                                            
│ Change which setting?       (Return or Esc to exit)     
└────────────────────────────────────┘
配置完成后,可按enter或esc进行退出,最后返回minicom -s的菜单,选save setup as df1,将设置保存为默认配置。这样,就设置完成了。

3)连好console线,之后运行minicom程序。
#minicom

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/24325.html