树莓派蓝牙转串口方法
型号3B+
检查设备,此时的状态为
lrwxrwxrwx 1 root root 5 Jul 25 14:19 serial0 -> ttyS0
lrwxrwxrwx 1 root root 7 Jul 25 14:19 serial1 -> ttyAMA0
进入控制台,执行
sudo nano /boot/config.txt
在文末添加
enable_uart=1
dtoverlay=pi3-miniuart-bt
禁用蓝牙服务
sudo systemctl stop serial-getty@ttyAMA0.service
sudo systemctl disable serial-getty@ttyAMA0.service
执行
sudo nano /boot/cmdline.txt
删除以下部分
console=serial0(or ttyAMA0),115200
重启检查设备状态,如果成功,将为如下状态
lrwxrwxrwx 1 root root 7 Jul 25 14:27 serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Jul 25 14:27 serial1 -> ttyS0