蓝牙无法工作。 MPOW BH519A

蓝牙无法工作。 MPOW BH519A

我正在尝试让我的 MPOW BH519A 蓝牙适配器正常工作。有类似的帖子,其中一篇是关于此适配器的。不幸的是,我尝试了所有方法,但没有任何帮助。我已经测试过一些命令,例如:
  • sudo apt安装blueman
  • sudo make install INTERFACE=all (MPOW Linux 驱动程序下载,在文件夹内运行此命令)
  • sudo mv -v ~/下载/rtl8761b_config /usr/lib/firmware/rtl_bt/rtl8761b_config.bin
  • 快速安装 bluez4
  • 快速安装 bluez
  • sudo apt install bluez bluez-obexd
  • sudo apt-get install bluez-utils libopemnobex1
  • sudo apt 重新安装 bluez
  • sudo blueman-经理

我什至无法让领导跑。我设法将控件设置为打开,但它显示“未找到蓝牙适配器”。经过多次尝试不同的命令后,我什至无法将控件设置为打开。


我感觉我可能有重复或者只是忽略了一些重要的东西,因为我是一个完全的 Ubuntu 初学者。

这里有一些输出。不幸的是,我不知道哪些信息对您有帮助。

lsb_release -a
没有可用的 LSB 模块。
发行商 ID:Ubuntu
描述:Ubuntu 20.04.2 LTS
版本:20.04
代号:focal

$ dmesg | grep -i 蓝牙
[2.308927] USB 3-2:产品:蓝牙无线电
[18.340266]蓝牙:核心版本2.22
[18.340297]蓝牙:HCI设备和连接管理器初始化
[18.340301]蓝牙:HCI套接字层初始化
[18.340303]蓝牙:L2CAP套接字层初始化
[ 18.340306]蓝牙:SCO套接字层初始化
[55.439177]审核:类型= 1400审核(1627551927.132:64):apparmor =“拒绝”操作=“创建”配置文件=“snap.bluetooth-autostart.autostart-bluetooth”pid = 883 comm ="hciconfig" family="bluetooth" sock_type="raw" protocol=1 requests_mask="create" Denied_mask="create"

[ 65.993297] 蓝牙:BNEP(以太网仿真)版本 1.3
[ 65.993300] 蓝牙:BNEP 过滤器:协议多播
[ 65.993305]蓝牙:BNEP套接字层初始化

〜$ echo“选项btusb启用_自动挂起= 0”| sudo tee -a /etc/modprobe.d/btusb.conf
选项 btusb启用_自动挂起=0

〜$ systemctl | grep -i 蓝色
run-snapd-ns-bluetooth\x2dautostart.mnt.mount 已加载主动安装 /run/snapd/ns/bluetooth-autostart.mnt

snap-bluetooth\x2dautostart-10.mount 已加载主动安装 蓝牙自动启动的安装单元,修订版 10

蓝牙.service 已加载活动正在运行的蓝牙服务

● snap.bluetooth-autostart.autostart-bluetooth.service 已加载失败 失败 snap 应用程序 bluetooth-autostart.autostart-bluetooth 的服务

〜$ lsusb
总线 002 设备 001:ID 1d6b:0002 Linux Foundation 2.0 根集线器 总线
004 设备 001:ID 1d6b:0001 Linux Foundation 1.1 根集线器
总线 001 设备 004:ID 2357:0109 TP-Link TL WN823N RTL8192EU
总线 001 设备 001:ID 1d6b:0002 Linux Foundation 2.0 根集线器 总线
003 设备 004:ID 093a:2510 Pixart Imaging, Inc. 光电鼠标
总线 003 设备 003:ID 0bda:2550 Realtek Semiconductor Corp. 蓝牙无线电
总线 003 设备 002:ID 046d:c52b Logitech, Inc. Unifying 接收
器 总线 003 设备 001:ID 1d6b:0001 Linux Foundation 1.1 根
集线器 总线 008 设备 001:ID 1d6b:0003 Linux Foundation 3.0 根集线器
总线 007 设备 001:ID 1d6b:0002 Linux Foundation 2.0 根集线器 总线
006 设备 001:ID 1d6b:0003 Linux Foundation 3.0 根集线器 总线
005 设备 001:ID 1d6b:0002 Linux Foundation 2.0 根集线器

rfkill 列出所有
0:phy0:无线 LAN
软阻止:无
硬阻止:无

我很感激每一个答案。

[编辑]

20200610_LINUX_BT_DRIVER/20200610_LINUX_BT_DRIVER/uart/bluetooth_uart_driver/hci_ldisc.c:1086:22:错误:分配给'ssize_t(*)(struct tty_struct *,struct file *,unsigned char, size_t, void **, long unsigned int)' {又名 'long int ()(struct tty_struct *, struct file *, unsigned char, long unsigned int, void **, long unsigned int)'} 来自不兼容的指针类型 'ssize_t ()(struct tty_struct *, struct file *, unsigned char, size_t)' {又名 'long int (1086 | 结构体tty_struct *,结构体文件*,无符号字符*,长无符号整型)'} hci_uart_ldisc.read = hci_uart_tty_read; | ^ cc1:一些警告被视为错误

这是 hci_ldisc.c 文件的代码:

/*
 * We don't provide read/write/poll interface for user space.
 */
static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file,
                 unsigned char __user * buf, size_t nr)
{
    return 0;
}

static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file,
                  const unsigned char *data, size_t count)
{
    return 0;
}

static unsigned int hci_uart_tty_poll(struct tty_struct *tty,
                      struct file *filp, poll_table * wait)
{
    return 0;
}

static int __init hci_uart_init(void)
{
    static struct tty_ldisc_ops hci_uart_ldisc;
    int err;

    BT_INFO("HCI UART driver ver %s", VERSION);

    /* Register the tty discipline */

    memset(&hci_uart_ldisc, 0, sizeof(hci_uart_ldisc));
    hci_uart_ldisc.magic = TTY_LDISC_MAGIC;
    hci_uart_ldisc.name = "n_hci";
    hci_uart_ldisc.open = hci_uart_tty_open;
    hci_uart_ldisc.close = hci_uart_tty_close;
    hci_uart_ldisc.read = hci_uart_tty_read;
    hci_uart_ldisc.write = hci_uart_tty_write;
    hci_uart_ldisc.ioctl = hci_uart_tty_ioctl;
    hci_uart_ldisc.poll = hci_uart_tty_poll;
    hci_uart_ldisc.receive_buf = hci_uart_tty_receive;
    hci_uart_ldisc.write_wakeup = hci_uart_tty_wakeup;
    hci_uart_ldisc.owner = THIS_MODULE;

[编辑] 运行时“sudo make install 接口=usb

mkdir -p /lib/modules/5.11.0-27-generic/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p /lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to /lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw /lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config /lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config /lib/firmware
make -C usb install
make[1]: Verzeichnis „/home/ubuntu/Schreibtisch/20200610_LINUX_BT_DRIVER/20200610_LINUX_BT_DRIVER/usb“ wird betreten
rmmod btusb
rmmod: ERROR: Module btusb is not currently loaded
make[1]: [Makefile:7: install] Fehler 1 (ignoriert)
mv /lib/modules/5.11.0-27-generic/kernel/drivers/bluetooth/btusb.ko /lib/modules/5.11.0-27-generic/kernel/drivers/bluetooth/btusb_bak
mv: Aufruf von stat für '/lib/modules/5.11.0-27-generic/kernel/drivers/bluetooth/btusb.ko' nicht möglich: Datei oder Verzeichnis nicht gefunden
make[1]: [Makefile:8: install] Fehler 1 (ignoriert)
rmmod rtk_btusb
rmmod: ERROR: Module rtk_btusb is not currently loaded
make[1]: [Makefile:9: install] Fehler 1 (ignoriert)
make -C ./bluetooth_usb_driver
make[2]: Verzeichnis „/home/ubuntu/Schreibtisch/20200610_LINUX_BT_DRIVER/20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver“ wird betreten
make -C /lib/modules/5.11.0-27-generic/build M=/home/ubuntu/Schreibtisch/20200610_LINUX_BT_DRIVER/20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver modules
make[3]: Verzeichnis „/usr/src/linux-headers-5.11.0-27-generic“ wird betreten
make[3]: Verzeichnis „/usr/src/linux-headers-5.11.0-27-generic“ wird verlassen
make[2]: Verzeichnis „/home/ubuntu/Schreibtisch/20200610_LINUX_BT_DRIVER/20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver“ wird verlassen
cp -f ./bluetooth_usb_driver/rtk_btusb.ko /lib/modules/5.11.0-27-generic/kernel/drivers/bluetooth/rtk_btusb.ko
depmod -a 5.11.0-27-generic
make -C ./bluetooth_usb_driver clean
make[2]: Verzeichnis „/home/ubuntu/Schreibtisch/20200610_LINUX_BT_DRIVER/20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver“ wird betreten
rm -rf *.o *.mod.c *.mod.o *.ko *.symvers *.order *.a
make[2]: Verzeichnis „/home/ubuntu/Schreibtisch/20200610_LINUX_BT_DRIVER/20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver“ wird verlassen
echo "install rtk_btusb success!"
install rtk_btusb success!
make[1]: Verzeichnis „/home/ubuntu/Schreibtisch/20200610_LINUX_BT_DRIVER/20200610_LINUX_BT_DRIVER/usb“ wird verlassen

[编辑]LSSB

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 2357:0109 TP-Link TL WN823N RTL8192EU
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 004: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 003 Device 005: ID 0bda:2550 Realtek Semiconductor Corp. Bluetooth Radio
Bus 003 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

[编辑]dmesg | grep -i 蓝牙

[    2.334631] usb 3-2: Product: Bluetooth Radio
[   10.740679] Bluetooth: Core ver 2.22
[   10.740735] Bluetooth: HCI device and connection manager initialized
[   10.740743] Bluetooth: HCI socket layer initialized
[   10.740748] Bluetooth: L2CAP socket layer initialized
[   10.740758] Bluetooth: SCO socket layer initialized
[   10.989363] Bluetooth: HCI UART driver ver 2.3
[   10.989373] Bluetooth: HCI UART protocol H4 registered
[   10.989376] Bluetooth: HCI UART protocol BCSP registered
[   10.989416] Bluetooth: HCI UART protocol LL registered
[   10.989419] Bluetooth: HCI UART protocol ATH3K registered
[   10.989439] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   10.989480] Bluetooth: HCI UART protocol Intel registered
[   10.989537] Bluetooth: HCI UART protocol Broadcom registered
[   10.989557] Bluetooth: HCI UART protocol QCA registered
[   10.989560] Bluetooth: HCI UART protocol AG6XX registered
[   10.989581] Bluetooth: HCI UART protocol Marvell registered
[   65.224399] audit: type=1400 audit(1630557966.917:64): apparmor="DENIED" operation="create" profile="snap.bluetooth-autostart.autostart-bluetooth" pid=902 comm="hciconfig" family="bluetooth" sock_type="raw" protocol=1 requested_mask="create" denied_mask="create"
[  786.789070] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[  786.789077] Bluetooth: BNEP filters: protocol multicast
[  786.789084] Bluetooth: BNEP socket layer initialized
[ 1005.431927] usb 3-2: Product: Bluetooth Radio

答案1

我在使用同一个适配器时遇到了类似的问题 - 没有被识别。显然,它的 USB pid 在rtk_misc.c在MPOW下载的驱动源码包中。

这是对我有用的修复:

  1. 编辑从 MPOW 下载的驱动程序包中提取的rtk_misc.c文件夹中的文件。usb/bluetooth_usb_driver我的是名为20201202_LINUX_BT_DRIVER
  2. 复制并粘贴第 311 行以添加缺少的 pid,例如
    {0x2550, 0x8761, "mp_rtl8761b_fw", "rtl8761bu_fw", "rtl8761bu_config", NULL, 0}, /* MPOW BH519AB RTL8761BU only */
    
  3. 搜索行读数(最初为第 939 行):
    patch->chip_type = RTL8761BU;
    
  4. 在其上方添加突出显示的 case 语句,
    案例0x8771:  
     案例0xa725:  
     案例0xa72A:  
     案例0x2550:
     
  5. 保存并重复 make install 以构建和安装驱动程序并尝试适配器

相关内容