deepin使用串口工具的使用方法
Tofloor
poster avatar
memelsky
deepin
2016-04-02 08:29
Author
最近弄来了一根DT-5002A的usb转RS232的线,查询资料后发现其芯片为PL2303芯片。现需要使用deepin连接该通讯线。一开始使用官方的驱动,总是装不上。官方的驱动是基于红帽设计的,deepin试了一下似乎不能用。官方驱动是有源码的,但是编译过程中还是出了点问题,不成功。

最后查询了网上的方法,总结归纳以后可以使用。现梳理汇总如下:
1、命令行运行find寻找pl2303.ko,在/usr/src/linux-headers-4.2.0-1-amd64/include/config/usb/serial下找到usbserial.ko    pl2303.ko
  1. wwb@wwb-pc:/$sudo find / -name serial
Copy the Code
2、在驱动目录下执行如下命令安装驱动模块
  1. wwb@wwb-pc:/$insmod usbserial.ko
  2. wwb@wwb-pc:/$insmod pl2303.ko
Copy the Code
3、界面提示两个ko已经存在了,再执行lsmod 查看模块装载的情况
  1. wwb@wwb-pc:/$ lsmod | grep pl2303
  2. pl2303                 20480  0
  3. usbserial              49152  1 pl2303
Copy the Code
4、查看系统控制台的输出,确定驱动已经注册
  1. wwb@wwb-pc:/$ dmesg | grep pl2303
  2. [   12.815865] usbcore: registered new interface driver pl2303
  3. [   12.815883] usbserial: USB Serial support registered for pl2303
  4. [   12.815899] pl2303 1-2:1.0: pl2303 converter detected
  5. [   12.816462] usb 1-2: pl2303 converter now attached to ttyUSB0
Copy the Code
5、确定了端口号是 ttyUSB0 以后,查看/dev/ttyUSB0发现这是一个主设备为188的字符驱动。
  1. wwb@wwb-pc:/$  ls -l /dev/ttyUSB0
  2. crw-rw---- 1 root dialout 188, 0 4月   1 23:41 /dev/ttyUSB0
Copy the Code
6、运行 minicom -s进行配置。选择Serial port setup
  1. +-----[configuration]------+
  2.             | Filenames and paths       |
  3.             | File transfer protocols      |
  4.             | Serial port setup                 |
  5.             | Modem and dialing           |
  6.             | Screen and keyboard       |
  7.             | Save setup as dfl                 |
  8.             | Save setup as..                     |
  9.             | Exit                                            |
  10.             | Exit from Minicom              |
  11.             +--------------------------+
Copy the Code
7、进入串口配置,设置后保存
  1.     +-----------------------------------------------------------------------+
  2.     | A -    Serial Device      : /dev/ttyUSB0                              |
  3.     | B - Lockfile Location     : /var/lock                                 |
  4.     | C -   Callin Program      :                                           |
  5.     | D -  Callout Program      :                                           |
  6.     | E -    Bps/Par/Bits       : 115200 8N1                                |
  7.     | F - Hardware Flow Control : No                                        |
  8.     | G - Software Flow Control : No                                        |
  9.     |                                                                       |
  10.     |    Change which setting?                                              |
  11.     +-----------------------------------------------------------------------+
Copy the Code
8、下次输入sudo minicom即可通信。
Reply Favorite View the author
All Replies
avatar
大川小朋友
deepin
2023-04-19 19:20
#1

问一下第一步没有找到pl2303.ko应该怎么办呢

Reply View the author