关于Ubantu系统中蓝牙问题及一些解决思路

当我们想要在Ubantu系统(可能别的系统也会遇到)中打开蓝牙的时候,可能会提示:

1.没有检测到蓝牙适配器 / 蓝牙守护进程未启动 / BlueZ未运行 等等信息。

这时我们可以用命令:

systemctl status bluetooth.service

来检查我们的蓝牙服务是否处于运行状态。

如果提示:

● bluetooth.service - Bluetooth service
  Loaded: loaded(/usr/lib/systemd/system/bluetooth.service; disabled; vendor preset: disabled)
  Active: inactive (dead)
  Docs: man:bluetoothd(8)

那么很明显我们的蓝牙服务已经失效,需要激活一下,激活也很简单,只需要两行命令即可。

sudo modprobe btusb
sudo systemctl start bluetooth.service
sudo systemctl enable bluetooth.service

sudo modprobe btusb //加载通用的蓝牙驱动程序
sudo systemctl start bluetooth.service //启动蓝牙服务
sudo systemctl enable bluetooth.service //使蓝牙服务开机自启

此时再用我们的检测命令,就能看到:
在这里插入图片描述
完成~

2021/10/26
更新两种蓝牙错误情况:

2.rfkill报错

使用命令查询蓝牙状态

systemctl status bluetooth.service

会看到报错提示:

Failed to set mode:Blocked through rfkill(0x12)

//这种情况大致可以理解为蓝牙被rfkill设备(/dev/rfkill?)阻止/封锁了

解决方法为:

sudo rfkill unblock bluetooth

sudo systemctl restart bluetooth

sudo rfkill unblock bluetooth //使得rfkill解除对蓝牙服务的封锁
sudo systemctl start bluetooth.service //重启蓝牙服务

3.hci0设备报错

使用命令查询蓝牙状态

systemctl status bluetooth.service

会看到

loadin LTKs timed out for hci0

解决方法为:

sudo hciconfig hci0 down
sudo rmmod btusb
sudo modprobe btusb
sudo hciconfig hci0 up
sudo systemctl restart bluetooth.service

sudo hciconfig hci0 down //配置hci0蓝牙设备关闭
sudo rmmod btusb //移除btusb蓝牙模块
sudo modprobe btusb //重新加载btusb蓝牙模块
sudo hciconfig hci0 up //配置hci0蓝牙设备启动
sudo systemctl start bluetooth.service //重启蓝牙服务

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值