【精品】rockylinux/Centos/Ubantu蓝牙不能打开了,一招解决

上次开机还能连接Airpods,再开机突然发现蓝牙无法打开

原因:暂时不明,欢迎懂得兄弟们留言讨论!(6.1号找到原因了)

即使点了打开,也没用!!
在这里插入图片描述

解决方案

//打开终端执行
sudo rmmod btusb
sleep 1
sudo modprobe btusb

在这里插入图片描述
**

****后续追加

**
这段时间在写文章,平时不喜欢关机,都是挂起suspend操作,几次之后发现又出现了这个问题,而且用上面的方法也不好用了,这让绵羊哥很是疑惑,经过亿顿搜索和排查后,发现了原因:
主要原因是电脑待机挂起后,usb也自动挂起了,然后蓝牙就不工作了,而唤醒电脑后也不能智能的唤醒usb,找到原因就好操作,直接把usb挂起的操作关闭,永远保持mount。
原因如下:

0x01 - Bluetooth: hci0: Failed to send firmware data (-110)[1]

[    6.111317] Bluetooth: hci0: command 0xfc09 tx timeout
[   14.218049] Bluetooth: hci0: Failed to send firmware data (-110)

检查:

systemctl status bluetooth.service
● bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-09-10 14:44:54 CEST; 31min ago
     Docs: man:bluetoothd(8)
 Main PID: 913 (bluetoothd)
   Status: "Running"
$ bluetoothctl
[Bluetoothctl] $ power on

> No default controller available

[Bluetoothctl]  $ scan on

> No default controller available

诊断: USB auto-suspend 导致的错误.常常在笔记本电脑没电后 suspend 不完全导致错误. 又或是安装了 laptop-mode 后更改设置选项导致的错误.解决方法: disable USB auto-suspend[1]

touch /etc/modprobe.d/usb-autosuspend.conf
vim /etc/modprobe.d/usb-autosuspend.conf
修改为-1
options usbcore autosuspend=-1

方案二:

cd /sys/bus/usb/devices/

手动将/sys/bus/usb/devices/usb*/power/autosuspend更改为“ -1”而不是“ 0”。

关机,重启。熟悉的蓝牙又出现了
在这里插入图片描述

Reference
【1】https://www.zhihu.com/column/p/189843430?utm_medium=social&utm_source=weibo

当您看到错误消息"no bean named 'redistemplate' available"时,通常是因为您没有在Spring容器中正确地配置RedisTemplate bean。 RedisTemplate是Spring Data Redis提供的一个用于与Redis服务器进行交互的工具类。要在Spring应用程序中使用RedisTemplate,您需要进行以下配置: 1. 在您的Spring配置文件(例如applicationContext.xml)中,确保已经导入了Spring Data Redis的命名空间,例如: ```xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:redis="http://www.springframework.org/schema/data/redis" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/data/redis http://www.springframework.org/schema/data/redis/spring-data-redis.xsd"> ``` 2. 在配置文件中定义Redis连接工厂bean,用于与Redis服务器建立连接。例如: ```xml <bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"> <!-- 配置Redis服务器连接参数,例如host和port --> <property name="hostName" value="localhost"/> <property name="port" value="6379"/> </bean> ``` 3. 在配置文件中定义RedisTemplate bean,并将redisConnectionFactory注入到RedisTemplate中。例如: ```xml <bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"> <property name="connectionFactory" ref="redisConnectionFactory"/> <!-- 配置Redis数据格式转换器,例如Redis键的序列化方式 --> <property name="keySerializer" ref="stringRedisSerializer"/> <property name="valueSerializer" ref="stringRedisSerializer"/> </bean> ``` 以上配置示例是最基本的RedisTemplate配置,您还可以根据需要进行其他配置,例如设置数据的序列化方式、添加Redis服务器的认证等。 确保以上配置正确无误后,重新启动您的应用程序,错误消息"no bean named 'redistemplate' available"应该会解决
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值