Unable to open serial port /dev/ttyUSB0

ubuntu12.04使用USB转串口时出现权限不够问题,如下

权限不够

解决办法:

通过增加udev规则来实现。步骤如下:
创建文件/etc/udev/rules.d/70-ttyusb.rules
在文件内增加一行
KERNEL=="ttyUSB[0-9]*", MODE="0666"
重新插入USB转串口设备,普通用户就有权限访问了。

70-ttyusb.rules文件还有另一种写法,先用lsusb查看USB转串口芯片的idVendor和idProduct
#lsusb
显示结果中有这么一行
Bus 005 Device 007: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
ID 0403:6001表示idVendor=0403,idProduct=6001
70-ttyusb.rules的内容如下:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001",MODE="0666"
重新插入USB转串口设备,普通用户同样可以访问了

Unable to open serial port /dev/ttyUSB0

时间: 2024-10-30 15:40:20

Unable to open serial port /dev/ttyUSB0的相关文章

select/poll/epoll on serial port

In this article, I will use three asynchronous conferencing--select, poll and epoll on serial port to transmit data between PC and Raspberry pi. Outline Character device file of serial port Naive serial communication Asynchronous conferencing Select

Serial Port Programming on Linux(转载)

This is a tutorial on how to program the Serial Ports on your Linux box.Serial Ports are nice little interfaces on the PC which helps you to interface your embedded system projects using a minimum number of wires.In this tutorial we will write a smal

serial port 的操作

import serial①选择设备ser=serial.Serial("/dev/ttyUSB0",9600,timeout=0.5) #使用USB连接串行口ser=serial.Serial("/dev/ttyAMA0",9600,timeout=0.5) #使用树莓派的GPIO口连接串行口ser=serial.Serial(1,9600,timeout=0.5)#winsows系统使用com1口连接串行口ser=serial.Serial("com1

Non-standard serial port baud rate setting

////combuad_recv.cpp #include <stdio.h> /*标准输入输出定义*/ #include <stdlib.h> /*标准函数库定义*/ #include <unistd.h> /*Unix 标准函数定义*/ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> /*文件控制定义*/ #include <termios.h&

IntelliJ运行下载的Servlet时报错 Error running Tomcat 8.5.8: Unable to open debugger port (127.0.0.1:49551): java.net.SocketException

学习Java Servlet时,从Wrox上下载了示例代码,准备run/debug时发现以下错误: Error running Tomcat 8.5.8: Unable to open debugger port (127.0.0.1:49551): java.net.SocketException "Socket closed" /Users/GuQiang/Tomcat/apache-tomcat-8.5.8/bin/catalina.sh stopUsing CATALINA_B

串口总是报&#39;Error opening serial port&#39;

Comm1.CommName := '//./' + Trim(combx_Port.Text); 目前串口大于20  用上面方法解决的 网上也有上面方法解决如下错误的. 若是您已会应用SPCOMM且涌现10个以上的串心题目 请改一下串心名 COM1.CommName='//./com18'; 便如许减'//./'就好了我也没有晓得甚么回事....... 比方 Comm1.CommName := '//./'+ComboBox1.Text; //./com18是win] 如果你已经会使用SPCO

使用华为U8860测试时出现“Unable to open log device &#39;/dev/log/main&#39;: No such file or directory”

这是因为华为默认禁掉了log输出, 解决办法: 拨号: *#*#2846579#*#* 会显示工程菜单, Go to "ProjectMenu" -> "Background Setting" -> "Log Setting" Open "Log switch" and set it to ON. Open "Log level setting" and set the log level yo

logcat 提示 Unable to open log device &#39;/dev/log/main&#39;: No such file or directory

解决办法: Open: /system/etc/init.d/××× (not the same file on different ROMs, find the right file) Find the line that says: rm /dev/log/main Change the line to: # rm /dev/log/main (comments out the line, rm = remove, in case you were wondering) Save and r

IDEA Unable to open debugger port(idea不能打开调试器)

关键字 IDEA Unable to open debugger port  BindException: Address already in use: JVM_Bind 原因:IDEA配置的调试端口被占用了 解决方法: 方法一: 查找idea配置的调试端口--查看占用该端口的进程--杀掉进程 方法二:查找idea配置的调试端口--修改调试端口(未被使用的) 基本步骤: 1. 查看IDEA配置的调试端口,在IDEA配置tomcate的标签页,最后一个Tab页面(Startup/Connecti