arduino upload程序时 出现can't open device /dev/ttyUSB0

本文介绍如何解决在Linux系统中Arduino Uno R3板子上传程序时遇到的权限问题。通过修改udev规则,使得普通用户也能顺利进行Arduino程序的上传。

刚拿到手arduino uno r3板子,着急就和linux连上了,想跑以下ROS中的“hello world“程序,无奈upload程序的时候提示can't open device /dev/ttyUSB0,Permissions Denied,查了之后原来是linux 中的串口权限设置的问题,解决办法如下,首先“list -l /dev/ttyUSB0“会出现”crw-rw-rw- 1 root dialout 188, 0 11月  4 13:54 /dev/ttyUSB0“可以发现/dev/ttyUSB0是属于root用户的,普通用户没有权限使用,增加一个udev的规则,

Ubuntu 使用su获取root权限,执行

vi  /etc/udev/rules.d/70-ttyusb.rules          创建70-ttyusb.rules文件,在其中输入“KERNEL=="ttyUSB[0-9]*",MODE="0666"“保存退出,重新插拔以下USB,ok.



# 3D ViTac: Learning Fine-Grained Manipulation with Visuo-Tactile Sensing #### Project Website: https://binghao-huang.github.io/3D-ViTac/ This codebase contains python code and ros package for flexible tactile sensor in 3D-ViTac. To build the tactile sensors, follow the instructions below: [[Hardware Assembly Tutorial]](https://docs.google.com/document/d/1XGyn-iV_wzRmcMIsyS3kwcrjxbnvblZAyigwbzDsX-E/edit?tab=t.0#heading=h.ny8zu0pq9mxy) ,[[Bills of Material]](https://docs.google.com/document/d/1auxwAbAnt88nG7HDqanr4JJreuAVkrhs1nK16VQaLpk/edit?tab=t.0#heading=h.ny8zu0pq9mxy) ## 1. Firmware (1) Load the [arduino code](/arduino_code/MatrixArray.ino) to the arduino. ## 2. PYTHON(option 1) (1) Setup environment pip install pyserial pip install opencv-python==4.6.0.66 pip install threading pip install scipy (2)Start python visualization cd python python3 multi_thread_contact.py ## 3. ROS(option 2) 1. compile ros package(Assuming you have already installed ROS1) cd ros/tactile_ws catkin_make 3. rosrun tactile_sensor tactile_sensor.py ## 4. Multi Sensors name setup (optional) 1. setup multi thread tactile board name(Optional): - One issue that arises is the port each robot binds to can change over time, e.g. a robot that is initially ``ttyUSB0`` might suddenly become ``ttyUSB5``. - Take ``right_robot_left_finger``: right master robot as an example: 1. Find the port that the right master robot is currently binding to, e.g. ``ttyUSB0`` 2. run ``udevadm info --name=/dev/ttyUSB0 --attribute-walk | grep serial`` to obtain the serial number. Use the first one that shows up, the format should look similar to ``FT6S4DSP``. 3. ``sudo vim /etc/udev/rules.d/99-tactile.rules`` and add the following line: SUBSYSTEM=="tty", ATTRS{serial}=="<serial number here>", ENV{ID_MM_DEVICE_IGNORE}="1", ATTR{device/latency_timer}="1", SYMLINK+="right_robot_left_finger" 4. This will make sure the tactile
最新发布
07-27
Executable segment sizes: ICACHE : 32768 - flash instruction cache IROM : 249572 - code in flash (default or ICACHE_FLASH_ATTR) IRAM : 27277 / 32768 - code in IRAM (IRAM_ATTR, ISRs...) DATA : 1504 ) - initialized variables (global, static) in RAM/HEAP RODATA : 1320 ) / 81920 - constants (global, static) in RAM/HEAP BSS : 25848 ) - zeroed variables (global, static) in RAM/HEAP Sketch uses 279673 bytes (29%) of program storage space. Maximum is 958448 bytes. Global variables use 28672 bytes (35%) of dynamic memory, leaving 53248 bytes for local variables. Maximum is 81920 bytes. esptool.py v3.0 Serial port COM8 Traceback (most recent call last): File "C:\Users\27505\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1/tools/upload.py", line 66, in <module> esptool.main(cmdline) File "C:/Users/27505/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/3.0.1/tools/esptool\esptool.py", line 3551, in main esp = chip_class(each_port, initial_baud, args.trace) File "C:/Users/27505/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/3.0.1/tools/esptool\esptool.py", line 283, in __init__ self._port.write_timeout = DEFAULT_SERIAL_WRITE_TIMEOUT File "C:/Users/27505/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/3.0.1/tools/pyserial\serial\serialutil.py", line 392, in write_timeout self._reconfigure_port() File "C:/Users/27505/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/3.0.1/tools/pyserial\serial\serialwin32.py", line 224, in _reconfigure_port 'Original message: {!r}'.format(ctypes.WinError())) serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: PermissionError(13, '����ϵͳ�ϵ��豸û�з������á�', None, 31) Failed uploading: uploading error: exit status 1
07-01
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值