赞
踩
使用指令:
ls /dev/ttyUSB*
查询到的结果
xxx@XXX:~$ ls /dev/ttyUSB*
/dev/ttyUSB0
“/dev/ttyUSB0”即为要查询的端口号,相当于Windows里面的 “COM0”,注意填写端口号时,需要完整填写“/dev/ttyUSB0”,而不是只写“ttyUSB0”
groups
查询结果:
xxx@XXX:~$ groups
xxx adm dialout sudo plugdev lpadmin sambashare
Ubuntu下读写串口,必须先把当前用户加入到dialout分组
dialout: Full and direct access to serial ports. Members of this group can reconfigure the modem, dial anywhere, etc.
sudo usermod -a -G dialout xxx #xxx为用户名
sudo usermod -a -G plugdev xxx #xxx为用户名
plugdev: Allows members to mount (only with the options nodev and nosuid, for security reasons) and umount removable devices through pmount.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。