ag旗舰厅官网_ag旗舰厅下载客户端

热门关键词: ag旗舰厅官网,ag旗舰厅下载客户端

关于计算机

当前位置:ag旗舰厅官网 > 关于计算机 > Linux系统中Usb转串口的使用方法,在Linux下用min

Linux系统中Usb转串口的使用方法,在Linux下用min

来源:http://www.pedaLyourcycLe.com 作者:ag旗舰厅官网 时间:2019-10-20 07:48

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

首先,安装minicom:sudo apt-get install minicom
在装置好minicom之后对minicom举行配置,在这里,供给小心的一些是在Linux景况下不准要装Usb转串口的驱动,在这里,使用lsmod命令
                        z75993971@Ubuntu:~$ lsmod
                        Module                  Size  Used by
                        pl2303                 13696  0
                        usbserial              39507  1 pl2303
                        binfmt_misc             7984  1
看得出,linux可以自动识别2303设施
从此在顶峰中输入dmesg | grep usb命令
                       z75993971@ubuntu:~$ dmesg | grep usb
                       [    0.497563] usbcore: registered new interface driver usbfs
                       [    0.497574] usbcore: registered new interface driver hub
                       [    0.497601] usbcore: registered new device driver usb
                       [    1.001716] usb 2-3: new high speed USB device using ehci_hcd and address 2
                       [   18.178144] input: USB 2.0 Camera as /devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3:1.0/input/input5
                       [   18.178198] usbcore: registered new interface driver uvcvideo
                       [   64.090038] usb 6-1: new full speed USB device using uhci_hcd and address 2
                       [   64.328761] usbcore: registered new interface driver usbserial
                       [   64.328807] usbcore: registered new interface driver usbserial_generic
                       [   64.328810] usbserial: USB Serial Driver core
                       [   64.362942] usb 6-1: pl2303 converter now attached to ttyUSB0
                       [   64.362970] usbcore: registered new interface driver pl2303
只顾上边加红的地点,他指明了设备号为:ttyUSB0
后来,就足以开展mimicom的配备了

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?      
└────────────────────────────────┘

在终端中输入: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        |
            +--------------------------+
布局成如下形式:
    +-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyUSB0                              |
    | 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?                                              |
    +--------------------------------------------------------------------
完结后脱离,退出后跻身   Modem and dialing 配置成如下格局:
(原因:我们应用的是串口,而不Modem)
 +--------------------[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 setup as dfl 
到此,迷你com的布局达成,连上串口线,展开开垦板电源就能够以知道到串口输出的打字与印刷消息

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

===== 三.Minicom的使用 =====

┌───[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,将设置保存为私下认可配置。那样,就安装达成了。

1.minicom的执行
用指令"rpm -qa | grep minicom"来确认是还是不是安装了minicom,回车的前边会展现minicom 的版本音信.
第一次 启动时:
即输入 minicom提示 错误。则 需: minicom -s
启动
并发表局菜单:选serial port setup
进去串口配置
输入A配置串口驱动为/dev/ttyS0
输入E配置速率为115200 8N1
输入F将 Hardware Flow Control 设 为 NO
回车 退出
是因为我们使用minicom作为超级终端调节路由器等设 备, 并不是决定modem, 所以必要修改Modem and dialing, 将Init string, Reset string, Hang-up string设置为空. 设置完结后选拔Save setup as dfl将近些日子安装保存为暗中同意设置.
在计划菜单 选Save setup as df1保存(必供给记得这一步)
选Exit退出

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

后一次在输入minicon 就能够直接步向。
命令minicom是踏向串口一级终端画面,而minicom -s为配置minicom
表达/dev/ttyS0 对应该为串口0 为你总是开采板的端口。

4)离开minicon。
按 Ctrl+A,再按Z,能够赢得在console下操作的help;
按Ctrl+A,再按Q,能够相差minicon,如:
         ┌─────────────┐
         │ Leave without reset?
         │     Yes       No  
         └─────────────┘
万风华正茂,你一贯甘休了minicom的话,也能够通过linux下kill来杀到minicom的线程。

静心:非不荒谬关闭minicom,会在/var/lock下创建多少个公文LCK*,这么些文件阻止了minicom的周转,将它们删除后就能够苏醒图片 1

图片 2

本文由ag旗舰厅官网发布于关于计算机,转载请注明出处:Linux系统中Usb转串口的使用方法,在Linux下用min

关键词:

上一篇:Linux下搭建Android开发环境图文详解

下一篇:没有了