Examples

bluetoothctl命令提示No default controller available

在学习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设备了。

 

posted on 2020-05-25 15:28  足各火丁  阅读(10516)  评论(0)    收藏  举报

导航

Examples