关闭串口调试功能,打开串口:
- 执行命令进入树莓派配置:
sudo raspi-config
依次选择5. Interfacing Options ->Serial ->no -> yes
- 打开/boot/config.txt文件,查找是否存在
enable_uart=1
不存在则在最后添加
如果是树莓派3B,板载的串口ttyAMA0作为蓝牙使用,用户串口端口改为ttySO
sudo raspi-config
5. Interfacing Options ->Serial ->no -> yes
enable_uart=1
不存在则在最后添加如果是树莓派3B,板载的串口ttyAMA0作为蓝牙使用,用户串口端口改为ttySO