bluetoothctl没有可用的默认控制器

时间:2018-01-16 10:58:45

标签: bluetooth bluez

这里有点连线。

我有一个问题是bluetoothctl总是说"没有默认控制器"。我发现有很多人跟我有同样的问题。但情况与他们有点不同。

我可以看到我的hciconfig -a有如下信息 enter image description here

hcitool dev似乎也没问题。 enter image description here

但我不知道为什么我的bluetoothctl总是说"没有默认控制器" enter image description here

即使我拒绝并多次调高hci0。它始终存在同样的问题。

顺便说一下,我的BlueZ是5.39。我在buildroot上尝试了这个实验。内核是3.10

7 个答案:

答案 0 :(得分:9)

有同样的问题。采用: $ sudo bluetoothctl

然后自动找到控制器。我之前也尝试过https://www.raspberrypi.org/forums/viewtopic.php?t=207025。也许这影响了解决方案。

答案 1 :(得分:8)

如果rfkill开关阻止了蓝牙(在我的情况下,由于某些无意的原因),也会发生这种情况:

$ rfkill list all

0: tpacpi_bluetooth_sw: Bluetooth
    Soft blocked: yes
    Hard blocked: no

要取消阻止,请将蓝牙设备的ID从上面的列表传递到unblock子命令:

$ rfkill unblock 0

然后控制器应返回:

$ bluetoothctl list
Controller .... [default]

答案 2 :(得分:1)

以下是通过修改bluez配置和无需sudo的运行为我工作的步骤:

  • 在bluez的d-bus配置上创建一个<allow send_destination="org.bluez"/>授予的“蓝牙”组
  

$ sudo groupadd蓝牙

  • 使用您喜欢的文本编辑器在/etc/dbus-1/system.d/bluetooth.conf中打开配置

    例如
  

$ sudo vi /etc/dbus-1/system.d/bluetooth.conf

  • 在/etc/dbus-1/system.d/bluetooth.conf

    中添加/添加以下行


    <policy group="bluetooth">
    <allow send_destination="org.bluez"/>
    </policy>

  • 保存您的更改。

  • 将您的登录用户添加到“蓝牙”组

  

$ sudo usermod -a -G蓝牙

  • 重新启动系统。

  • 然后尝试在不使用sudo的情况下使用“ bluetoothctl”

      

    $ bluetoothctl
      [蓝牙]#显示

答案 3 :(得分:1)

它是旧线程,但可能会帮助寻找答案的人。

我大多数时候都遇到过这个问题,我证实的事情是:

  1. systemctl status bluetooth ==这将检查蓝牙服务守护程序是否已在运行。 检查输出:
    已加载:已加载(/lib/systemd/system/bluetooth.service;已启用;供应商预设:已启用) 活动:活动(运行中) 如果没有,请使用以下命令启动它: sudo systemctl start bluetooth

  2. 使用 sudo蓝牙

这两个通常是罪魁祸首。

答案 4 :(得分:0)

我有同样的问题。经过长期研究,发现未安装驱动程序。检查答案https://unix.stackexchange.com/questions/545019/bluetooth-doesnt-work-in-debian-10,看看驱动程序是否正确安装=)

答案 5 :(得分:0)

The answer above可能适用于某些发行版,但可能使您陷入其他发行版的麻烦。不幸的是,似乎每个发行版的蓝牙默认配置都不同,恕我直言。

以下是在Debian衍生版本的Raspberry Pi OS(néeRaspbian)上为我工作的内容:

作为初步检查,您可以在许多发行版中检查/etc/group以查看是否存在组名bluetooth

$ cat /etc/group | grep blue

如果存在,您显然不需要添加组,只需将用户添加到组中即可。

$ sudo usermod -G bluetooth -a <username>

在我正在使用的发行版中,这就是使Controller在bluetoothctl中具有响应能力所需要的全部内容。

答案 6 :(得分:0)

我在 Linux Kernel 5.12 上使用 VanillaArch 时遇到了这个问题。 经过一天的努力,我发现问题是:

1.一些蓝牙设备固件在开箱即用的新 linux 库中不可用,您需要找到。 对于此问题,您可以参考以下 repo。在自述文件中,它详细记录了您应该做什么。基本上你会下载并复制固件

<块引用>

/lib/firmware/brcm

适用于 Broadcom 蓝牙设备。
https://github.com/winterheart/broadcom-bt-firmware

2.在蓝牙上激活两个相互冲突的服务。 参考 Arch 论坛上的“SayantanRC”:

<块引用>

当我比较两者时,我发现这两个服务在我的 Manjaro 安装中启用,但在我的 Arch linux 安装中禁用:

blueman-mechanism.service
bluetooth-mesh.service
<块引用>

禁用它们并重新启动。

sudo systemctl disable blueman-mechanism.service
sudo systemctl disable bluetooth-mesh.service
<块引用>

现服务如下:

~ >>> systemctl list-unit-files | grep blue                                                                                                                                           
blueman-mechanism.service                  disabled        disabled     
bluetooth-mesh.service                     disabled        disabled     
bluetooth.service                          enabled         disabled     
dbus-org.bluez.service                     alias           -            
bluetooth.target                           static          -            
~ >>>      

        
<块引用>

瞧,蓝牙启动了!

~ >>> bluetoothctl                                                                                                                                                                    
Agent registered
[CHG] Controller 68:07:15:DE:1F:15 Pairable: yes
[bluetooth]# show
Controller 68:07:15:DE:1F:15 (public)
    Name: src-manjaro
    Alias: src-manjaro
    Class: 0x00000000
    Powered: no
    Discoverable: no
    DiscoverableTimeout: 0x000000b4
    Pairable: yes
    UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
    UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
    UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
    UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
    UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
    UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
    UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
    Modalias: usb:v1D6Bp0246d0537
    Discovering: no
    Roles: central
    Roles: peripheral
Advertising Features:
    ActiveInstances: 0x00 (0)
    SupportedInstances: 0x05 (5)
    SupportedIncludes: tx-power
    SupportedIncludes: appearance
    SupportedIncludes: local-name
[bluetooth]# quit
<块引用>

编辑:出于验证目的,我重新启用了服务并 蓝牙适配器又出问题了。我禁用了它们,它是 现在好了。检查内核 5.9 和 5.4。

https://bbs.archlinux.org/viewtopic.php?id=259260&p=2