藍牙無法正常工作。MPOW BH519A
我正在嘗試讓我的 MPOW BH519A 藍牙適配器工作。有類似的文章,包括關於此適配器的文章。不幸的是,我嘗試了所有這些,但沒有任何幫助。我已經測試了一些命令,例如:
- sudo apt install blueman
- sudo make install INTERFACE=all (MPOW Linux Driver 下載,在文件夾裡面執行這個命令)
- sudo mv -v ~/Downloads/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-manager
我什至無法讓 LED 執行。我設法將控制項設置為打開,但它顯示“未找到藍牙適配器”。在多次嘗試使用不同的命令後,我什至無法將控制項設置為打開。
因為我是一個完整的 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 $$審計:type=1400 審計(1627551927.132:64):apparmor=“DENIED” operation=“create” profile=“snap.bluetooth-autostart.autostart-bluetooth” pid=883 comm=“hciconfig” family=“bluetooth” sock_type= “原始”協議 = 1 請求遮罩 =“創建”被拒絕遮罩 =“創建”
$$ 65.993297 $$藍牙:BNEP(乙太網仿真)ver 1.3
$$ 65.993300 $$藍牙:BNEP 過濾器:協議組播
$$ 65.993305 $$藍牙:BNEP 套接字層已初始化
~$ echo “options btusb enable_autosuspend=0” | sudo tee -a /etc/modprobe.d/btusb.conf
選項 btusb enable_autosuspend=0
~$ systemctl | grep -i blue
run-snapd-ns-bluetooth\x2dautostart.mnt.mount 載入主動安裝 /run/snapd/ns/bluetooth-autostart.mnt
snap-bluetooth\x2dautostart-10.mount 載入主動安裝 藍牙自動啟動的安裝單元, 修訂版 10
bluetooth.service 載入了主動執行的藍牙服務
● snap.bluetooth-autostart.autostart-bluetooth.service loaded failed failed 用於 snap 應用程序 bluetooth-autostart.autostart-bluetooth 的服務
~$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 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 Receiver
Bus 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 root hub
rfkill list all
0:phy0:無線 LAN
軟阻塞:否
硬阻塞:否 我感謝每一個答案。
$$ EDIT $$ 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)’ {aka ’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)’ {aka ’long int ( )(struct tty_struct *, struct file *, unsigned char *, long unsigned int)’}
$$ -Werror=incompatible-pointer-types $$ 1086 | 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;
$$ EDIT $$ 執行“ sudo make install INTERFACE=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
$$ Edit $$ lsusb
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
$$ Edit $$ 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
我在使用同一個適配器時遇到了類似的問題 - 沒有被辨識。顯然,從 MPOW 下載的驅動程序源包中的rtk_misc.c中缺少它的 USB pid 。
這是對我有用的修復:
- 編輯從 MPOW 下載的驅動程序包中提取
rtk_misc.c
的文件夾中的文件。usb/bluetooth_usb_driver
我的是名為20201202_LINUX_BT_DRIVER
- 複製並粘貼第 311 行以添加缺少的 pid,例如
{0x2550, 0x8761, "mp_rtl8761b_fw", "rtl8761bu_fw", "rtl8761bu_config", NULL, 0}, /* MPOW BH519AB RTL8761BU only */
- 搜尋行讀數(最初是第 939 行):
patch->chip_type = RTL8761BU;
- 在其上方添加突出顯示的 case 語句,
案例 0x8771: 案例 0xa725: 案例 0xa72A: *案例 0x2550:*
- 保存並重複 make install 以建構和安裝驅動程序並嘗試適配器