关于raspberry pi基于bluetoothctl连接BLE低功耗蓝牙并进行数据传输

本文介绍了如何在Raspberry Pi上使用bluetoothctl工具连接低功耗蓝牙(BLE)设备,并进行数据传输。通过安装、启动bluetoothctl,扫描设备,连接目标设备,查看和操作特定的Characteristic,实现读取和订阅功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近做项目遇到需使用树莓派连接低功耗蓝牙的功能,终于找到一个适合Ubuntu系统的蓝牙连接工具:bluetoothctl。

首先,确保树莓派安装有bluetoothctl,具体安装步骤可参照以下链接:https://mcuoneclipse.com/2016/12/19/tutorial-ble-pairing-the-raspberry-pi-3-model-b-with-hexiwear/

确保树莓派bluetoothctl安装完成后,启动:

pi@raspberrypi: ~bluetoothctl
Waiting to connect to bluetoothd...

启动完成,输入help可以看到所有的命令

[bluetooth]# help
Available commands:
  list                       List available controllers
  show [ctrl]                Controller information
  select <ctrl>              Select default controller
  devices                    List available devices
  paired-devices             List paired devices
  power <on/off>             Set controller power
  pairable <on/off>          Set controller pairable mode
  discoverable <on/off>      Set controller discoverable mode
  agent <on/off/capability>  Enable/disable agent with given capability
  d
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值