Chinaunix首页 | 论坛 | 博客
  • 博客访问: 270793
  • 博文数量: 50
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 919
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-03 19:18
个人简介

非淡泊无以明志,非宁静无以致远

文章分类

全部博文(50)

文章存档

2018年(2)

2017年(6)

2016年(7)

2015年(10)

2014年(11)

2013年(14)

我的朋友

分类: LINUX

2014-03-18 10:38:34

minicom的使用:  
需要先对minicom进行配置,不能直接输入minicom,因为minicom运行时默认在/dev下有modem这个目录,而实际并没有,因此要修改默认的配置。一般第一次启动,需要使用命令minicom –s 对minicom进行配置,配置完成后,选择Save setup as df1,以后就可以直接使用minicom了。
(0)安装minicom,未配置前在终端中输入命令minicom,提示如:
#minicom
minicom: there is no global configuration file /etc/minirc.dfl
Ask your sysadmin to create one (with minicom -s).
(1)在root下,输入命令minicom –s,屏幕出现如下的界面:
# minicom -s
minicom: WARNING: configuration file not found, using defaults
             +-----[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           |
            +------------------------------+
(2)设置serial port setup
  使用down箭头选择serial port setup,出现具体各选项的配置:
     +-----------------------------------------------------------------------+
    | A -     Serial Device       : /dev/modem                                     |
    | B - Lockfile Location      : /var/lock                                          |        
    | C -    Callin Program       :                                                     |
    | D -  Callout Program       :                                                    |
    | E -     Bps/Par/Bits        : 115200 8N1                                  |
    | F - Hardware Flow Control : Yes                                          |
    | G - Software Flow Control : No                                           |
     |                                                                                              |
    |     Change which setting?                                                      |
     +-----------------------------------------------------------------------+
说明:
将选项A的值设置为/dev/ttyS0表示是串口1,如用串口2,设置为/dev/ttyS1,依次类推;
将选项E的值(波特率)设置为115200;
将选项F的值(硬件流)改成No;
设置过程中命令的使用,例如需要修改选项A的值,在Change with setting?选项后输入
A则光标转移到A选项后,可以对A选项的值进行修改。
修改完后的界面如下:
      +---------------------------------------------------------------------+
     | A -     Serial Device       : /dev/ttyS0                                       |
     | B - Lockfile Location      : /var/lock                                      |
     | C -    Callin Program       :                                                    |
     | D -  Callout Program       :                                                   |
     | E -     Bps/Par/Bits        : 115200 8N1                                  |
     | F - Hardware Flow Control : No                                         |
     | G - Software Flow Control : No                                          |

     |     Change which setting?                                                   | 
      +----------------------------------------------------------------------+
按回车退回[configuration]界面。
(3)在[configuration]界面中,选择Save setup as dfl。

退出 Serial port setup 后,进入Modem and dialing,设置内容如下 :

  具体就是去掉A — initing string ……:,B — Reset string ……: K — Hang-up string ……三个配置项,至于为啥要这样子设置,嘿嘿,不清楚了。回头再看,工程呐,有时候必须抱有“不求甚解”的态度,刨根问底的想法我还放其他地方。

 ┌────────────────────[Modem and dialing parameter setup]─────────────────────┐
 │                                                                            │
 │ A - Init string .........                                                  │
 │ B - Reset string ........                                                  │
 │ 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 ......                                                  │
 │ 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)                        │
 └────────────────────────────────────────────────────────────────────────────┘

而后,退出选择Save as df1选项将修改后的配置信息进行保存为默认的配置选项,再来个Exit from minicom,搞定。。。。

  选择Save setup as dfl选项将修改后的配置信息进行保存为默认的配置选项。
(4)选择Exit from minicom 。
  选择Exit from minicom 选项从配置菜单返回到命令行。
(5)重新启动minicom,则可以使用。出现的界面如下:
#minicom
Welcome to minicom 2.3
OPTIONS: I18n
Compiled on Feb 26 2009, 00:28:35.
Port /dev/ttyS0
                Press CTRL-A Z for help on special keys
附加说明:
    minicom 启动后,先按 Ctrl+A 键,再按 Z 键(注意不是连续按,Ctrl+A松开后才按 Z) ,进入主配置界面。如按q可退回终端。
Welc     +---------------------------------------------------------------+
              |                      Minicom Command Summary               |
OPTIO |                                                                                     |
Compi  |         Commands can be called by CTRL-A      |
Port      |                                                               |
|                             Main Functions                   Other Functions               |
|                                                                                                               |
| Dialing directory.......D     run script (Go).....G | Clear Screen...     ....C |
| Send files.................S     Receive files.........R | cOnfigure Minicom..O |
| comm Parameters....P     Add linefeed.........A | Suspend minicom....J |
| Capture on/off..........L     Hangup.................H | eXit and reset.........X |
| send break..............F     initialize Modem....M | Quit with no reset. ..Q |
| Terminal settings...T     run Kermit..............K | Cursor key mode......I |
| lineWrap on/off.......W     local Echo on/off....E | Help screen.............Z |
| Paste file.................Y                                       | scroll Back...............B |
|                                                                                                               |
|       Select function or press Enter for none.                                           |
|                                                                                                              |
|              Written by Miquel van Smoorenburg 1991-1995                        |
|              Some additions by Jukka Lahtinen 1997-2000                        |
|              i18n by Arnaldo Carvalho de Melo 1998                                  |
+-------------------------------------------------------------------------------------+
阅读(2199) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~