描述
从 AliExpress 购买了一个蓝牙 USB 适配器,并尝试在我的 Ubuntu 机器上进行设置。有人可以帮忙吗?准备提供任何日志,只需在评论中告诉我即可。
注意:这不是笔记本电脑,而是 PC
我有典型症状:
- 插入适配器
- 打开蓝牙 GUI 菜单
- 尝试打开蓝牙,但没有任何反应
我已经检查了 SO 上的几个答案,但没有什么帮助。提前致谢!
日志
lspci -nnk | grep -iA3 net; lsusb; rfkill list; uname -r; sudo dmesg | egrep -i 'blue|firm'
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (7) I219-V [8086:15bc] (rev 10) DeviceName: Onboard - Ethernet Subsystem: Gigabyte Technology Co., Ltd Ethernet Connection (7) I219-V [1458:e000] Kernel driver in use: e1000e Kernel modules: e1000e 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 3GB] [10de:1c02] (rev a1) Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 005: ID 046d:c077 Logitech, Inc. M105 Optical Mouse Bus 001 Device 009: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) Bus 001 Device 003: ID 0c45:62f1 Microdia USB 2.0 Camera Bus 001 Device 006: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader Bus 001 Device 004: ID 256c:006e Bus 001 Device 002: ID 058f:6254 Alcor Micro Corp. USB Hub Bus 001 Device 007: ID 046d:c52b Logitech, Inc. Unifying Receiver Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 1: hci0: Bluetooth Soft blocked: no Hard blocked: no 5.8.0-44-generic [ 0.095153] Spectre V2 : Enabling Restricted Speculation for firmware calls [ 7.098296] snd_hda_intel 0000:00:1f.3: Applying patch firmware 'hda-jack-retask.fw' [ 7.117587] snd_hda_intel 0000:01:00.1: Applying patch firmware 'hda-jack-retask.fw' [ 9190.046929] Bluetooth: Core ver 2.22 [ 9190.046946] Bluetooth: HCI device and connection manager initialized [ 9190.046949] Bluetooth: HCI socket layer initialized [ 9190.046950] Bluetooth: L2CAP socket layer initialized [ 9190.046952] Bluetooth: SCO socket layer initialized [ 9190.056876] Bluetooth: hci0: CSR: Unbranded CSR clone detected; adding workarounds... [ 9190.097840] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 9190.097841] Bluetooth: BNEP filters: protocol multicast [ 9190.097844] Bluetooth: BNEP socket layer initialized [15290.811144] Bluetooth: hci0: CSR: Unbranded CSR clone detected; adding workarounds...
bluetoothctl
Agent registered [bluetooth]# list [bluetooth]# devices No default controller available [bluetooth]# scan on No default controller available [bluetooth]# power on No default controller available
sudo systemctl status bluetooth
● bluetooth.service - Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2021-02-28 13:19:48 EET; 1h 9min ago Docs: man:bluetoothd(8) Main PID: 1171 (bluetoothd) Status: "Running" Tasks: 1 (limit: 19054) Memory: 2.3M CGroup: /system.slice/bluetooth.service └─1171 /usr/lib/bluetooth/bluetoothd лют 28 13:19:47 alexandrtovmach bluetoothd[1171]: src/main.c:parse_controller_config() Key file does not have group “Controller” лют 28 13:19:47 alexandrtovmach bluetoothd[1171]: src/main.c:parse_controller_config() Key file does not have group “Controller” лют 28 13:19:47 alexandrtovmach bluetoothd[1171]: src/main.c:parse_controller_config() Key file does not have group “Controller” лют 28 13:19:47 alexandrtovmach bluetoothd[1171]: src/main.c:parse_controller_config() Key file does not have group “Controller” лют 28 13:19:47 alexandrtovmach bluetoothd[1171]: src/main.c:parse_controller_config() Key file does not have group “Controller” лют 28 13:19:47 alexandrtovmach bluetoothd[1171]: src/main.c:parse_controller_config() Key file does not have group “Controller” лют 28 13:19:47 alexandrtovmach bluetoothd[1171]: src/main.c:parse_controller_config() Key file does not have group “Controller” лют 28 13:19:48 alexandrtovmach systemd[1]: Started Bluetooth service. лют 28 13:19:48 alexandrtovmach bluetoothd[1171]: Starting SDP server лют 28 13:19:48 alexandrtovmach bluetoothd[1171]: Bluetooth management interface 1.17 initialized
sudo /usr/lib/bluetooth/bluetoothd -n -d
bluetoothd[16969]: Bluetooth daemon 5.55 bluetoothd[16969]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “DiscoverableTimeout” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “AlwaysPairable” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “PairableTimeout” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “Privacy” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “JustWorksRepairing” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “TemporaryTimeout” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “Name” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “Class” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “DeviceID” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “ReverseServiceDiscovery” in group “General” bluetoothd[16969]: src/main.c:parse_config() Key file does not have group “GATT” bluetoothd[16969]: src/main.c:parse_config() Key file does not have group “GATT” bluetoothd[16969]: src/main.c:parse_config() Key file does not have group “GATT” bluetoothd[16969]: src/main.c:parse_config() Key file does not have group “GATT” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/main.c:parse_controller_config() Key file does not have group “Controller” bluetoothd[16969]: src/adapter.c:adapter_init() sending read version command bluetoothd[16969]: Starting SDP server bluetoothd[16969]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:0537 bluetoothd[16969]: src/plugin.c:plugin_init() Loading builtin plugins bluetoothd[16969]: src/plugin.c:add_plugin() Loading hostname plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading wiimote plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading autopair plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading policy plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading a2dp plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading avrcp plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading network plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading input plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading hog plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading gap plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading scanparam plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading deviceinfo plugin bluetoothd[16969]: src/plugin.c:add_plugin() Loading battery plugin bluetoothd[16969]: src/plugin.c:plugin_init() Loading plugins /usr/lib/x86_64-linux-gnu/bluetooth/plugins bluetoothd[16969]: src/plugin.c:add_plugin() Loading sixaxis plugin bluetoothd[16969]: profiles/input/suspend-none.c:suspend_init() bluetoothd[16969]: profiles/network/manager.c:read_config() /etc/bluetooth/network.conf: Key file does not have key “DisableSecurity” in group “General” bluetoothd[16969]: profiles/network/manager.c:read_config() Config options: Security=true bluetoothd[16969]: plugins/hostname.c:read_dmi_fallback() chassis: desktop bluetoothd[16969]: plugins/hostname.c:read_dmi_fallback() major: 0x01 minor: 0x01 bluetoothd[16969]: plugins/sixaxis.c:sixaxis_init() bluetoothd[16969]: src/main.c:main() Entering main loop bluetoothd[16969]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 2 op 0 soft 0 hard 0 bluetoothd[16969]: Bluetooth management interface 1.17 initialized bluetoothd[16969]: src/adapter.c:read_version_complete() sending read supported commands command bluetoothd[16969]: src/adapter.c:read_version_complete() sending read index list command bluetoothd[16969]: src/adapter.c:read_commands_complete() Number of commands: 70 bluetoothd[16969]: src/adapter.c:read_commands_complete() Number of events: 37 bluetoothd[16969]: src/adapter.c:read_commands_complete() enabling kernel-side connection control bluetoothd[16969]: src/adapter.c:read_commands_complete() kernel supports the set_blocked_keys op bluetoothd[16969]: src/adapter.c:read_commands_complete() kernel supports exp features bluetoothd[16969]: src/adapter.c:read_index_list_complete() Number of controllers: 0 bluetoothd[16969]: src/profile.c:register_profile() sender :1.143 bluetoothd[16969]: src/profile.c:create_ext() Created "Message Notification" bluetoothd[16969]: src/profile.c:register_profile() sender :1.143 bluetoothd[16969]: src/profile.c:create_ext() Created "Message Access" bluetoothd[16969]: src/profile.c:register_profile() sender :1.143 bluetoothd[16969]: src/profile.c:create_ext() Created "Phone Book Access" bluetoothd[16969]: src/profile.c:register_profile() sender :1.143 bluetoothd[16969]: src/profile.c:create_ext() Created "Synchronization" bluetoothd[16969]: src/profile.c:register_profile() sender :1.143 bluetoothd[16969]: src/profile.c:create_ext() Created "File Transfer" bluetoothd[16969]: src/profile.c:register_profile() sender :1.143 bluetoothd[16969]: src/profile.c:create_ext() Created "Object Push" bluetoothd[16969]: src/profile.c:register_profile() sender :1.143 bluetoothd[16969]: src/profile.c:create_ext() Created ":1.143/org/bluez/obex/00005005_0000_1000_8000_0002ee000001/00005005-0000-1000-8000-0002ee000001" bluetoothd[16969]: src/profile.c:register_profile() sender :1.77 bluetoothd[16969]: src/profile.c:create_ext() Created "Headset Voice gateway" bluetoothd[16969]: src/profile.c:register_profile() sender :1.77 bluetoothd[16969]: src/profile.c:create_ext() Created "Headset unit" bluetoothd[16969]: plugins/hostname.c:property_changed() static hostname: alexandrtovmach bluetoothd[16969]: plugins/hostname.c:property_changed() pretty hostname: bluetoothd[16969]: plugins/hostname.c:property_changed() chassis: desktop bluetoothd[16969]: src/agent.c:add_default_agent() Default agent set to :1.151 /org/bluez/agent bluetoothd[16969]: src/agent.c:agent_ref() 0x5594518e0220: ref=1 bluetoothd[16969]: src/agent.c:register_agent() agent :1.151 bluetoothd[16969]: src/agent.c:agent_disconnect() Agent :1.151 disconnected bluetoothd[16969]: src/agent.c:remove_default_agent() Default agent cleared bluetoothd[16969]: src/agent.c:agent_destroy() agent :1.151 bluetoothd[16969]: src/agent.c:agent_unref() 0x5594518e0220: ref=0 bluetoothd[16969]: src/agent.c:add_default_agent() Default agent set to :1.152 /org/bluez/agent bluetoothd[16969]: src/agent.c:agent_ref() 0x5594518e0220: ref=1 bluetoothd[16969]: src/agent.c:register_agent() agent :1.152 bluetoothd[16969]: src/agent.c:agent_disconnect() Agent :1.152 disconnected bluetoothd[16969]: src/agent.c:remove_default_agent() Default agent cleared bluetoothd[16969]: src/agent.c:agent_destroy() agent :1.152 bluetoothd[16969]: src/agent.c:agent_unref() 0x5594518e0220: ref=0 bluetoothd[16969]: src/agent.c:add_default_agent() Default agent set to :1.153 /org/bluez/agent bluetoothd[16969]: src/agent.c:agent_ref() 0x5594518e0220: ref=1 bluetoothd[16969]: src/agent.c:register_agent() agent :1.153 bluetoothd[16969]: src/agent.c:agent_disconnect() Agent :1.153 disconnected bluetoothd[16969]: src/agent.c:remove_default_agent() Default agent cleared bluetoothd[16969]: src/agent.c:agent_destroy() agent :1.153 bluetoothd[16969]: src/agent.c:agent_unref() 0x5594518e0220: ref=0
hciconfig
hci0: Type: Primary Bus: USB BD Address: 00:1A:7D:DA:71:13 ACL MTU: 679:8 SCO MTU: 48:16 DOWN RX bytes:367 acl:0 sco:0 events:12 errors:0 TX bytes:37 acl:0 sco:0 commands:12 errors:0
hciconfig -a hci0
hci0: Type: Primary Bus: USB BD Address: 00:1A:7D:DA:71:13 ACL MTU: 679:8 SCO MTU: 48:16 DOWN RX bytes:367 acl:0 sco:0 events:12 errors:0 TX bytes:37 acl:0 sco:0 commands:12 errors:0 Features: 0xbf 0x3e 0x4d 0xfa 0xdb 0x3d 0x7b 0xc7 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: Link mode: SLAVE ACCEPT
答案1
$ lsusb *** You already did
$ hciconfig
$ hciconfig -a hci0 *** As this appears to be your bluetooth device
另外,还有一些关于该设备问题的帖子供应商 ID/设备 ID数字与您的数字相同(0a12:0001)。
- 蓝牙适配器配置问题(ID 0a12:0001)。请注意答案,除了需要您尝试一些繁琐的程序外,它们还对您启动和运行加密狗的机会有所帮助。不值得在这里重新发布解决方案,因为它们在 askubuntu 中。
- https://gist.github.com/nevack/6b36b82d715dc025163d9e9124840a07
- https://bbs.archlinux.org/viewtopic.php?id=257372
- https://www.insanelymac.com/forum/topic/320630-sierra-bluetooth-usb-dongle-0x0a120x0001-doesnt-work-cheap/(仅限 Mac 相关信息也许有用)
有关的
答案2
诊断
您的输出显示解析问题/etc/bluetooth/main.conf
,例如:
bluetoothd[16969]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “DiscoverableTimeout” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “AlwaysPairable” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “PairableTimeout” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “Privacy” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “JustWorksRepairing” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “TemporaryTimeout” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “Name” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “Class” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “DeviceID” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have key “ReverseServiceDiscovery” in group “General”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have group “GATT”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have group “GATT”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have group “GATT”
bluetoothd[16969]: src/main.c:parse_config() Key file does not have group “GATT”
解决方案
/etc/bluetooth/main.conf
像这样备份:
sudo mv /etc/bluetooth/main.conf /etc/bluetooth/main.conf.old
然后像这样创建一个新的/etc/bluetooth/main.conf
:
sudo nano /etc/bluetooth/main.conf
然后将其复制并粘贴到文件编辑器中:
[General]
# Default adaper name
# Defaults to 'BlueZ X.YZ'
#Name = BlueZ
# Default device class. Only the major and minor device class bits are
# considered. Defaults to '0x000000'.
#Class = 0x000100
# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
#DiscoverableTimeout = 0
# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
#PairableTimeout = 0
# Automatic connection for bonded devices driven by platform/user events.
# If a platform plugin uses this mechanism, automatic connections will be
# enabled during the interval defined below. Initially, this feature
# intends to be used to establish connections to ATT channels. Default is 60.
#AutoConnectTimeout = 60
# Use vendor id source (assigner), vendor, product and version information for
# DID profile support. The values are separated by ":" and assigner, VID, PID
# and version.
# Possible vendor id source values: bluetooth, usb (defaults to usb)
#DeviceID = bluetooth:1234:5678:abcd
# Do reverse service discovery for previously unknown devices that connect to
# us. This option is really only needed for qualification since the BITE tester
# doesn't like us doing reverse SDP for some test cases (though there could in
# theory be other useful purposes for this too). Defaults to 'true'.
#ReverseServiceDiscovery = true
# Enable name resolving after inquiry. Set it to 'false' if you don't need
# remote devices name and want shorter discovery cycle. Defaults to 'true'.
#NameResolving = true
# Enable runtime persistency of debug link keys. Default is false which
# makes debug link keys valid only for the duration of the connection
# that they were created for.
#DebugKeys = false
# Restricts all controllers to the specified transport. Default value
# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).
# Possible values: "dual", "bredr", "le"
#ControllerMode = dual
# Enables Multi Profile Specification support. This allows to specify if
# system supports only Multiple Profiles Single Device (MPSD) configuration
# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple
# Devices (MPMD) configurations.
# Possible values: "off", "single", "multiple"
#MultiProfile = off
# Permanently enables the Fast Connectable setting for adapters that
# support it. When enabled other devices can connect faster to us,
# however the tradeoff is increased power consumptions. This feature
# will fully work only on kernel version 4.1 and newer. Defaults to
# 'false'.
#FastConnectable = false
[Policy]
# The ReconnectUUIDs defines the set of remote services that should try
# to be reconnected to in case of a link loss (link supervision
# timeout). The policy plugin should contain a sane set of values by
# default, but this list can be overridden here. By setting the list to
# empty the reconnection feature gets disabled.
#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb
# ReconnectAttempts define the number of attempts to reconnect after a link
# lost. Setting the value to 0 disables reconnecting feature.
#ReconnectAttempts=7
# ReconnectIntervals define the set of intervals in seconds to use in between
# attempts.
# If the number of attempts defined in ReconnectAttempts is bigger than the
# set of intervals the last interval is repeated until the last attempt.
#ReconnectIntervals=1, 2, 4, 8, 16, 32, 64
# AutoEnable defines option to enable all controllers when they are found.
# This includes adapters present on start as well as adapters that are plugged
# in later on. Defaults to 'false'.
AutoEnable=true
然后按Ctrl+x再按保存文件并关闭文件编辑器。yEnter
之后,重新启动系统并测试您的设备。
如果要将设备连接到外部 USB 集线器,请考虑将其直接连接到 PC 上的 USB 端口。
答案3
确保蓝牙处于活动状态并正在运行。 sudo systemctl status bluetooth.service
我已经使用 Ubuntu 服务一段时间了,可能名称略有不同。
如果它未处于活动状态且未运行,您将需要启用并启动该服务。
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
然后再次尝试 blueoothctl。
编辑:(对您没有影响,但对将来可能读到这篇文章的其他人有影响)如果这是笔记本电脑,请确保没有硬件开关,很多笔记本电脑都有,通常是 Control 或 Alt 之类的东西,也许是 Function 和 F 键之一。有几台笔记本电脑实际上有物理开关,虽然很少,但确实有。