Linuxer.
全部博文(199)
分类: LINUX
2013-09-12 17:44:49
二、环境串口无权限:
lenky@lenky-VirtualBox:~/桌面$ echo a > /dev/ttyS0
bash: /dev/ttyS0: 权限不够
解决方案:
1,查看串口对应的属性:
lenky@lenky-VirtualBox:~/桌面$ ls /dev/ttyS0 -l
crw-rw—- 1 root dialout 4, 64 9月 24 14:48 /dev/ttyS0
2,把当前帐号加入到串口所属组:
lenky@lenky-VirtualBox:~/桌面$ groups lenky
lenky : lenky adm cdrom sudo dip plugdev lpadmin sambashare
lenky@lenky-VirtualBox:~/桌面$ sudo gpasswd –add lenky dialout
[sudo] password for lenky:
正在将用户“lenky”加入到“dialout”组中
lenky@lenky-VirtualBox:~/桌面$ groups lenky
lenky : lenky adm dialout cdrom sudo dip plugdev lpadmin sambashare
3,注销后重新登录,再试,OK:
lenky@lenky-VirtualBox:~/桌面$ echo a > /dev/ttyS0
lenky@lenky-VirtualBox:~/桌面$