TEL
 
麒麟v10桌面USB转串口线驱动
作者:SuperAdministrator    发布于:2022-08-19 09:11:48    文字:【】【】【

麒麟v10sp1(龙芯3A5000),推荐串口调试工具:Serial port terminal,ssh调试推荐使用系统自带终端或是Putty (puTTY SSH Client)


1、查看usb串口号

2、下载pl2303 USB转串口驱动

3、安装步骤

4、查看效果

5、给串口权限

6、查看usb串口号


一般来说ubuntu都装有pl2303等常见USB转串口驱动,特别是340、341这些,但是也容易出现插上usb转串口线后找不到串口的情况如:

查看usb串口号

python -m serial.tools.list_ports

PL2303 usb转串口线驱动下载地址:https://prolificusa.com/product/pl2303gc-usb-full-uart-bridge-controller-gpio/

或是从产品官网驱动菜单下载:绿联 https://www.lulian.cn/download/list-108-cn.html

安装步骤

1.解压:进入下载/PL2303GT驱动       PL2303G_Linux_Driver_v1.0.6.zip


2.查看电脑内核版本

uname -r  或 桌面--计算机--右键--属性  查看,内核: xxxx


3.安装驱动

例如:进入“5.2_ok”文件夹打开终端运行

make all

sudo rmmod pl2303.ko

sudo insmod pl2303.ko

sudo cp pl2303.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial


4.拷贝pl2303.ko文件

sudo cp /lib/modules/5.4.0-70-generic/kernel/drivers/usb/serial/pl2303.ko /usr/src/linux-headers-5.4.0-70-generic/drivers/usb/serial

(注意把“5.4.0-70-generic”改为自己对应的内核版本名)

然后执行:

sudo modprobe usbserial

sudo modprobe pl2303


查看效果

此时应该是能识别到串口了

输入:dmesg | tail

发现多了一个:pl2303

输入: python -m serial.tools.list_ports

也能看见多了一个USB串口号:/dev/ttyUSB0


给串口权限

有时插上串口, 通过“python -m serial.tools.list_ports”指令能看见串口号,但是通过程序(ros或qt的串口类)运行时发现打不开串口


这种情况多是因为串口权限的问题

解决方法1

给单个串口权限

sudo chmod 666 /dev/ttyUSB0

该方法每次执行都需要给串口权限,不太方便。。。


解决方法2

建立.rules文件

sudo gedit /etc/udev/rules.d/20-usb-serial.rules

在.rules文件里写入:

KERNEL=="ttyUSB*" MODE="0666"

然后执行:

sudo service udev reload

sudo service udev restart

这样就不用每次给串口权限了。。。


脚注信息

 Copyright© 2018-2023  内蒙古天泽网络科技有限公司   /   产品销售:13269368666   /  技术服务:15849057770 

地址:内蒙古呼伦贝尔市海拉尔区天颐园水岸社区304  /  邮编:021008  /  电话/传真:0470-8340211    IT

 蒙公网安备 15070202000303号   /   蒙ICP备2021004025号-1  / 增值电信业务许可证:蒙B2-20211197 / 营业执照



呼伦贝尔信创    海拉尔信创    呼伦贝尔国产化    海拉尔国产化    数科    OFD    ofd    金山    WPS    wps    国产化    中孚    卫士通    国产操作系统  麒麟系统  国防部操作系统


亮照行动
.dangjianguan-header { position: relative; width: 100%; height: 800px; cursor: pointer; position: relative; } .djg-title { position: absolute; top: 174px; left: 377px; font-size: 78px; font-family: YouSheBiaoTiHei; font-weight: 400; color: #FFFFFF; } .djg-title-desc { position: absolute; top: 239px; left: 377px; font-size: 26px; font-family: Source Han Sans CN; font-weight: 400; color: #FFFFFF; } .djg-box { position: absolute; top: 340px; left: 377px; width: 600px; height: 140px; } .djg-box-item { display: flex; justify-content: space-between; margin: 30px 0px; } .djg-box-item-box { width: 275px; height: 30px; } .djg-box-item-box-mc { display: flex; align-items: center; } .djg-box-item-box-mc-desc { font-size: 18px; font-family: Source Han Sans CN; font-weight: 400; color: #FFFFFF; padding-left: 10px; } .djw-btn { position: absolute; top: 600px; left: 377px; } .djg-cc { display: flex; justify-content: center; align-items: center; flex-flow: column; } .djg-cc-title { margin-top: 56px; } .djg-cc-desc { margin-top: 32px; width: 977px; height: 88px; font-size: 20px; font-family: Source Han Sans CN; font-weight: 400; color: #666666; line-height: 34px; } .djg-cc-png { margin-top: 40px; margin-bottom: 68px; } .djg-cc-odd { background: #F6F6F6; } .djg-my-btn { display: flex; justify-content: center; align-items: center; width: 539px; height: 64px; background: #AD0000; border-radius: 32px; margin-bottom: 68px; font-size: 26px; font-family: Source Han Sans CN; font-weight: 400; color: #FFFFFF; cursor: pointer; line-height: 39px; } .erweima { position: absolute; top: 550px; left: 821px; } .saomaa { font-size: 18px; font-weight: bold; text-align: center; height: 28px; line-height: 28px; color: #fff; border-bottom: 1px solid #fff; } .iframe_class { width: 1920px; height: 666px; /* border: 1px red solid; */ }