pandaboard串口通信调试

1.在PC上的pyserial程序,到pandaboard后报错,读取和写入会报错

2.使用的是pandaboard的ttyO2串口

3.ls -l /dev/ttyO2,发现是tty,而不是dialout(串口登陆用、串口通信用)

4.pandaboard的ttyO2串口配置文件:原以为是/etc/init/serial.conf文件,最后发现是/etc/init/下ttyO2文件,将串口登陆的如下两行进行注释掉就为普通串口了,结果如下。

   #respawn
   #exec /sbin/getty -a ubuntu -L 115200 ttyS0

注:/dev/:设备文件

      /etc/:各种配置文件,所以要修改配置文件的时候,来这个目录下找。

     查属组:ls -l /dev/ttyS0

                ... root dialout ...

     查用户组:groups pi

     将用户加入组:sudo gpasswd --add pi dialout (将用户pi加入dialout组)

原文地址:https://www.cnblogs.com/cj2014/p/4157614.html