首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Raspberry PI 3 B+上找不到蓝牙设备- Ubuntu

在Raspberry PI 3 B+上找不到蓝牙设备- Ubuntu
EN

Ask Ubuntu用户
提问于 2019-07-06 21:42:35
回答 1查看 12.4K关注 0票数 4

当我安装bluez快照并使用hcitool时,我没有看到任何蓝牙设备,这没有任何结果:

代码语言:javascript
运行
复制
$ sudo hcitool dev
Devices:
$

或者蓝宝石:

代码语言:javascript
运行
复制
$ sudo bluetoothctl
Agent registered
[bluetooth]# list
[bluetooth]# show
No default controller available
[bluetooth]#

当我使用hc共图时,我得到了拒绝权限的错误:

$ sudo hc共图无法打开HCI套接字。:权限被拒绝$

我在dmesg中看到了以下消息,这些消息表明AppArmor正在拒绝尝试:

代码语言:javascript
运行
复制
21346.997174] audit: type=1400 audit(1562448858.001:1396): apparmor="DENIED" operation="create" profile="snap.bluez.hcitool" pid=6030 comm="hcitool" family="bluetooth" sock_type="raw" protocol=1 requested_mask="create" denied_mask="create

我需要做什么才能启用蓝牙设备,找到设备Id,并能够扫描新设备。

我手动连接了snap:用于bluez和蓝牙控制的即插即用,现在有以下连接:

代码语言:javascript
运行
复制
$ snap connections
Interface          Plug                                 Slot                Notes
bluetooth-control  bledetect101:bluetooth-control       :bluetooth-control  manual
bluetooth-control  bluez:bluetooth-control              :bluetooth-control  manual
bluetooth-control  hidra-ble-gateway:bluetooth-control  :bluetooth-control  manual
bluez              bluez:client                         bluez:service       -
network            bledetect101:network                 :network            -
network            hidra-ble-gateway:network            :network            -
uhid               bluez:uhid                           :uhid               -
$

在此运行之后,bluez.hciconfig将显示蓝牙设备:

代码语言:javascript
运行
复制
$ sudo hciconfig dev
hci0:   Type: Primary  Bus: SDIO
    BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0
    DOWN
    RX bytes:0 acl:0 sco:0 events:0 errors:0
    TX bytes:0 acl:0 sco:0 commands:0 errors:0  

但是,这将显示为down,并且尝试将其打开或重置它失败:

代码语言:javascript
运行
复制
$ sudo hciconfig hci0 up
Can't init device hci0: Input/output error (5)
$ sudo hciconfig hci0 reset
Can't init device hci0: Input/output error (5)
$

有什么想法吗?如前所述,这是在运行UbuntuCore18.04的RPI3 B+上实现的。未命名-a的输出:

代码语言:javascript
运行
复制
Linux localhost 4.15.0-1040-raspi2 #43-Ubuntu SMP PREEMPT Tue Jun 25 10:45:04 UTC 2019 armv7l armv7l armv7l GNU/Linux

添加dmesg输出:

代码语言:javascript
运行
复制
$ dmesg | grep -i 'bluetooth'
[   10.291904] Bluetooth: Core ver 2.21
[   10.291982] Bluetooth: HCI device and connection manager initialized
[   10.292000] Bluetooth: HCI socket layer initialized
[   10.292013] Bluetooth: L2CAP socket layer initialized
[   10.292036] Bluetooth: SCO socket layer initialized
[   10.305326] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
[   14.254238] audit: type=1400 audit(1562690889.887:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="snap.bluez.bluetoothctl" pid=949 comm="apparmor_parser"
[   17.377691] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   17.377713] Bluetooth: BNEP filters: protocol multicast
[   17.377736] Bluetooth: BNEP socket layer initialized
[  834.534698] audit: type=1400 audit(1562691819.528:25): apparmor="DENIED" operation="create" profile="snap.bluez.hciconfig" pid=1639 comm="hciconfig" family="bluetooth" sock_type="raw" protocol=1 requested_mask="create" denied_mask="create"
[  839.183488] audit: type=1400 audit(1562691824.176:26): apparmor="DENIED" operation="create" profile="snap.bluez.hciconfig" pid=1660 comm="hciconfig" family="bluetooth" sock_type="raw" protocol=1 requested_mask="create" denied_mask="create"
[  845.163961] audit: type=1400 audit(1562691830.156:27): apparmor="DENIED" operation="create" profile="snap.bluez.hciconfig" pid=1681 comm="hciconfig" family="bluetooth" sock_type="raw" protocol=1 requested_mask="create" denied_mask="create"
[  852.587936] audit: type=1400 audit(1562691837.580:28): apparmor="DENIED" operation="create" profile="snap.bluez.hciconfig" pid=1702 comm="hciconfig" family="bluetooth" sock_type="raw" protocol=1 requested_mask="create" denied_mask="create"
[ 1115.767865] audit: type=1400 audit(1562692100.757:48): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.bluez.bluetoothctl" pid=2506 comm="apparmor_parser"
[ 1219.232771] audit: type=1400 audit(1562692204.225:67): apparmor="DENIED" operation="create" profile="snap.bledetect101.bledetect-cli" pid=2867 comm="bledetect" family="bluetooth" sock_type="raw" protocol=1 requested_mask="create" denied_mask="create"
[ 1219.232819] audit: type=1400 audit(1562692204.225:68): apparmor="DENIED" operation="create" profile="snap.bledetect101.bledetect-cli" pid=2867 comm="bledetect" family="bluetooth" sock_type="raw" protocol=1 requested_mask="create" denied_mask="create"
EN

回答 1

Ask Ubuntu用户

发布于 2019-08-19 12:59:18

有一个错误,它使用错误的固件dir。作为临时修复,您可以使用以下命令:

代码语言:javascript
运行
复制
sudo ln -s /lib/firmware /etc/firmware

要检查它,您可以使用

代码语言:javascript
运行
复制
sudo hciattach /dev/ttyAMA0 bcm43xx 921600 -
票数 6
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1156466

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档