在树莓派上使用蓝牙适配器

  • 检查是否已经识别了蓝牙适配器
lsusb | grep blue -i
  • 安装蓝牙服务
apt-get install bluetooth
  • 启动蓝牙服务
service bluetooth restart
  • 查看蓝牙适配器是否工作正常
hcitool dev
  • 扫描周围的蓝牙设备
hcitool scan
  • 查看设备信息
hciconfig -a
  • 激活蓝牙适配器
hciconfig hci0 up
  • 运行周围的设备检测
hciconfig hciX piscan
  • 指定连接的pin码
start-stop-daemon -S -x /usr/bin/bluetooth-agent -c pi -b -- 0000
  • 查看提供的服务
sdptool browse local  

你可能感兴趣的:(蓝牙,适配器,树莓派)