bluetoothctl命令提示No default controller available
阅读原文时间:2023年07月13日阅读:1

在学习bluetoothctl命令时,执行bluetoothctl,然后执行show,提示No default controller available。

1. 执行hciconfig,发现有hci0,并且处于UP状态

2. 执行hcitool lescan,可以进行扫描。

3. 执行ps -ef|grep blue,有bluetoothd进程

4. 执行service --status-all | grep blue ,发现有bluetooth service。

后来发现,bluetoothd进程是系统自带的bluez执行的进程,而我执行的bluetoothctl是自己编译的bluez,难道是因为bluez版本问题?

解决方法:

1. 停止bluetoothd

rfkill block bluetooth
sudo service bluetooth stop
rfkill unblock bluetooth

2. 启动自己编译的bluetoothd

./bluetoothd -n -d  &

然后在执行./bluetoothctl, 就能检测到hci设备了。

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章