BuildRoot配置RTL8822CE WIFIBT模块(BT部分)

BuildRoot配置RTL8822CE WIFI&BT模块(WIFI部分)-CSDN博客

WIFI部分更新一下:

①、rkwifibt.mk

查看了output/rockchip_rk3399_tinkerboard2/build/的两个目录都有wifi相关的ko(后面make clean之后剩下linux-headers-custom路径的),md5都一样,随便选了一个,拷贝所有ko

zoipuus@ADM5800X:/home/workspace/BuildSpace/RepoProjects/Linux/buildroot$ md5sum output/rockchip_rk3399_tinkerboard2/build/*/drivers/net/wireless/rockchip_wlan/*/*.ko
0a6b7ee3fe2d637725cff8f04f5c4f25  output/rockchip_rk3399_tinkerboard2/build/linux-custom/drivers/net/wireless/rockchip_wlan/rtl8812AU_8821AU_linux/8812au.ko
eb38d81925a693ab33d47bd711515624  output/rockchip_rk3399_tinkerboard2/build/linux-custom/drivers/net/wireless/rockchip_wlan/rtl8814au/8814au.ko
35545c69741d15e728330ec295281361  output/rockchip_rk3399_tinkerboard2/build/linux-custom/drivers/net/wireless/rockchip_wlan/rtl8822ce/8822ce.ko
957baa941cea1254775d2ef9d72372bf  output/rockchip_rk3399_tinkerboard2/build/linux-custom/drivers/net/wireless/rockchip_wlan/rtl8852be/8852be.ko
0a6b7ee3fe2d637725cff8f04f5c4f25  output/rockchip_rk3399_tinkerboard2/build/linux-headers-custom/drivers/net/wireless/rockchip_wlan/rtl8812AU_8821AU_linux/8812au.ko
eb38d81925a693ab33d47bd711515624  output/rockchip_rk3399_tinkerboard2/build/linux-headers-custom/drivers/net/wireless/rockchip_wlan/rtl8814au/8814au.ko
35545c69741d15e728330ec295281361  output/rockchip_rk3399_tinkerboard2/build/linux-headers-custom/drivers/net/wireless/rockchip_wlan/rtl8822ce/8822ce.ko
957baa941cea1254775d2ef9d72372bf  output/rockchip_rk3399_tinkerboard2/build/linux-headers-custom/drivers/net/wireless/rockchip_wlan/rtl8852be/8852be.ko
diff --git a/package/rockchip/rkwifibt/rkwifibt.mk b/package/rockchip/rkwifibt/rkwifibt.mk
index aab7637a..e0bdadb9 100644
--- a/package/rockchip/rkwifibt/rkwifibt.mk
+++ b/package/rockchip/rkwifibt/rkwifibt.mk
@@ -46,7 +46,6 @@ define RKWIFIBT_INSTALL_COMMON$(INSTALL) -D -m 0755 $(@D)/wifi_start.sh $(TARGET_DIR)/usr/bin/$(INSTALL) -D -m 0755 $(@D)/wifi_ap6xxx_rftest.sh $(TARGET_DIR)/usr/bin/$(INSTALL) -D -m 0755 $(@D)/src/rk_wifi_init $(TARGET_DIR)/usr/bin/
-    $(INSTALL) -D -m 0644 $(TOPDIR)/../kernel/drivers/net/wireless/rockchip_wlan/rtl8822ce/*.ko $(TARGET_DIR)/vendor/lib/modules/$(SED) 's/WIFI_KO/\/$(FIRMWARE_DIR)\/lib\/modules\/$(BR2_PACKAGE_RKWIFIBT_WIFI_KO)/g' $(@D)/$(SXLOAD_WIFI)$(SED) 's/BT_TTY_DEV/\/dev\/$(BT_TTY_DEV)/g' $(@D)/$(SXLOAD_WIFI)-$(INSTALL) -D -m 0755 $(@D)/$(SXLOAD_WIFI) $(TARGET_DIR)/etc/init.d/
@@ -85,6 +84,7 @@ define RKWIFIBT_BROADCOM_INSTALLendefdefine RKWIFIBT_REALTEK_WIFI_INSTALL
+    $(INSTALL) -D -m 0644 $(@D)/../*/drivers/net/wireless/rockchip_wlan/*/*.ko $(TARGET_DIR)/vendor/lib/modules/$(INSTALL) -D -m 0755 $(@D)/bin/$(RKWIFIBT_ARCH)/rtwpriv $(TARGET_DIR)/usr/bin/$(INSTALL) -D -m 0755 $(@D)/$(SXLOAD_WIFI) $(TARGET_DIR)/etc/init.d/endef

②、移除对应package里面的.stamp_*是可以重新编译的

zoipuus@ADM5800X:/home/workspace/BuildSpace/RepoProjects/Linux$ rm buildroot/output/rockchip_rk3399_tinkerboard2/build/rkwifibt-1.0.0/.stamp_*
zoipuus@ADM5800X:/home/workspace/BuildSpace/RepoProjects/Linux$ ./build.sh buildroot2024-01-16T11:37:35 >>> rkwifibt 1.0.0 Syncing from source dir /home/workspace/BuildSpace/RepoProjects/Linux/buildroot/../external/rkwifibt
2024-01-16T11:37:35 >>> rkwifibt 1.0.0 Configuring
2024-01-16T11:37:35 >>> rkwifibt 1.0.0 Building

1、kernel配置

2、buildroot配置

2.1、BT_EN配置 

之前配置WIFI时已经知道板卡里面没有.ko文件,所以要查配置看哪里没有设置 

make menuconfig查看BR2_PACKAGE_RKWIFIBT_BT_EN属性为空,rkwifibt.sh无法执行BT相关的文件拷贝

 Symbol: BR2_PACKAGE_RKWIFIBT_BT_EN [=]                                                                                                                   ││ Type  : string                                                                                                                                           ││   Defined at package/rockchip/rkwifibt/Config.in:182                                                                                                     ││   Depends on: BR2_PACKAGE_ROCKCHIP [=y] && BR2_PACKAGE_RKWIFIBT [=y] 

修改Config.in,再make menuconfig查看BR2_PACKAGE_RKWIFIBT_BT_EN属性

diff --git a/package/rockchip/rkwifibt/Config.in b/package/rockchip/rkwifibt/Config.in
index 2adf0f7a..46aa6112 100644
--- a/package/rockchip/rkwifibt/Config.in
+++ b/package/rockchip/rkwifibt/Config.in
@@ -199,6 +199,7 @@ config BR2_PACKAGE_RKWIFIBT_BT_ENdefault "ENABLE" if BR2_PACKAGE_RKWIFIBT_RTL8723CSdefault "ENABLE" if BR2_PACKAGE_RKWIFIBT_RTL8723DSdefault "ENABLE" if BR2_PACKAGE_RKWIFIBT_RTL8821CS
+    default "ENABLE" if BR2_PACKAGE_RKWIFIBT_RTL8822CEdefault "DISABLE" if BR2_PACKAGE_RKWIFIBT_RK912endif
 Symbol: BR2_PACKAGE_RKWIFIBT_BT_EN [=ENABLE]                                                                                                             ││ Type  : string                                                                                                                                           ││   Defined at package/rockchip/rkwifibt/Config.in:182                                                                                                     ││   Depends on: BR2_PACKAGE_ROCKCHIP [=y] && BR2_PACKAGE_RKWIFIBT [=y] 

2.2、拷贝rtk_btusb.ko

diff --git a/package/rockchip/rkwifibt/rkwifibt.mk b/package/rockchip/rkwifibt/rkwifibt.mk
index aab7637a..1d721295 100644
--- a/package/rockchip/rkwifibt/rkwifibt.mk
+++ b/package/rockchip/rkwifibt/rkwifibt.mk
@@ -96,6 +96,7 @@ define RKWIFIBT_REALTEK_BT_INSTALL-$(INSTALL) -D -m 0644 $(@D)/realtek/$(BR2_PACKAGE_RKWIFIBT_CHIPNAME)/mp_* $(TARGET_DIR)/lib/firmware/rtlbt/-$(INSTALL) -D -m 0644 $(@D)/realtek/$(BR2_PACKAGE_RKWIFIBT_CHIPNAME)/mp_* $(TARGET_DIR)/lib/firmware/$(INSTALL) -D -m 0755 $(@D)/bt_realtek* $(TARGET_DIR)/usr/bin/
+    $(INSTALL) -D -m 0644 $(@D)/../*/drivers/bluetooth/rtk_btusb.ko $(TARGET_DIR)/usr/lib/modules/rtk_btusb.ko$(INSTALL) -D -m 0644 $(@D)/realtek/bluetooth_uart_driver/hci_uart.ko $(TARGET_DIR)/usr/lib/modules/hci_uart.ko$(INSTALL) -D -m 0755 $(@D)/bt_load_rtk_firmware $(TARGET_DIR)/usr/bin/$(SED) 's/BT_TTY_DEV/\/dev\/$(BT_TTY_DEV)/g' $(TARGET_DIR)/usr/bin/bt_load_rtk_firmware

2.3、bluez-utils配置 

3、处理编译问题

3.1、没有RTL8822CE路径 

2024-01-16T11:15:55 /usr/bin/install: cannot stat '/home/workspace/BuildSpace/RepoProjects/Linux/buildroot/output/rockchip_rk3399_tinkerboard2/build/rkwifibt-1.0.0/realtek/RTL8822CE/*': No such file or directory
2024-01-16T11:15:55 make[1]: *** [package/pkg-generic.mk:313: /home/workspace/BuildSpace/RepoProjects/Linux/buildroot/output/rockchip_rk3399_tinkerboard2/build/rkwifibt-1.0.0/.stamp_target_installed] Error 1
2024-01-16T11:15:55 make: *** [/home/workspace/BuildSpace/RepoProjects/Linux/buildroot/output/rockchip_rk3399_tinkerboard2/Makefile:16: _all] Error 2
Command exited with non-zero status 1
you take 2:24.42 to build builroot
ERROR: Running build_buildroot failed!
ERROR: exit code 1 from line 581:/usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $BOARD_CONFIG

确实没有RTL8822CE目录,有RTL8822CS

zoipuus@ADM5800X:/home/workspace/BuildSpace/RepoProjects/Linux$ ls -l buildroot/output/rockchip_rk3399_tinkerboard2/build/rkwifibt-1.0.0/realtek/
总计 60
drwxr-xr-x 3 zoipuus zoipuus  4096  1月 16 11:15 bluetooth_uart_driver
-rw-r--r-- 1 zoipuus zoipuus 30632  1月  9 22:09 bluetooth_uart_driver.7z
drwxr-xr-x 2 zoipuus zoipuus  4096  1月  9 22:09 bluetooth_usb_driver
drwxr-xr-x 4 zoipuus zoipuus  4096  1月  9 22:09 demo
drwxr-xr-x 2 zoipuus zoipuus  4096  1月  9 22:09 rtk_hciattach
drwxr-xr-x 2 zoipuus zoipuus  4096  1月  9 22:09 RTL8723DS
drwxr-xr-x 2 zoipuus zoipuus  4096  1月  9 22:09 RTL8821CS
drwxr-xr-x 2 zoipuus zoipuus  4096  1月  9 22:09 RTL8822CS

文件暂时拷贝RTL8822CS的,编译通过,运行

4、加载rtk_btusb.ko失败

手动加载rtk_btusb.ko

[root@rk3399:/]# insmod /usr/lib/modules/rtk_btusb.ko
[  113.943635] rtk_btusb: Realtek Bluetooth USB driver ver 3.1.32e1d0b.20210819-170430
[  113.944823] rtk_btcoex: rtk_btcoex_init: version: 1.2
[  113.945893] rtk_btcoex: create workqueue
[  113.947686] [root@rk3399:/]# rtk_btcoex: alloc buffers 1792, 2432 for ev and l2
[  113.949094] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNumber 0
[  113.950123] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[  113.951240] rtk_btusb: patch_add
[  113.952230] rtk_btusb: auto suspend is disabled
[  113.953196] rtk_btusb: pid = 0x3548
[  113.954158] rtk_btusb: patch_add: Reset gEVersion to 0xff
[  113.955074] rtk_btusb: set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
[  113.956496] rtk_btusb: btusb_probe: done
[  113.956532] rtk_btusb: btusb_open start
[  113.957596] usbcore: registered new interface driver rtk_btusb
[  113.963305] rtk_btusb: btusb_open hdev->promisc ==0
[  113.970062] rtk_btusb: download_patch start
[  113.975814] rtk_btusb: chip type value: 0x73
[  113.983969] rtk_btusb: HCI reset.
[  114.002215] rtk_btusb: read_ver_rsp->lmp_subver = 0x8822
[  114.006274] rtk_btusb: read_ver_rsp->hci_rev = 0xc
[  114.010257] rtk_btusb: patch_entry->lmp_sub = 0x8822
[  114.014345] rtk_btusb: load_firmware start
[  114.018482] rtk_btusb: lmp_version = 0x8822
[  114.022663] rtk_btusb: config filename rtl8822cu_config
[  114.027083] usb 6-1: Direct firmware load for rtl8822cu_config failed with error -2
[  114.031503] rtk_btusb: fw name is  rtl8822cu_fw
[  114.034913] usb 6-1: Direct firmware load for rtl8822cu_fw failed with error -2
[  114.038243] rtk_btusb: load firmware failed!
[  114.041601] rtk_btusb: Rtk patch end -1
[  114.044977] rtk_btusb: btusb_open failed

无法加载rtl8822cu_config和rtl8822cu_fw

drivers/bluetooth/rtk_misc.c 

(misc.c)load_config ->  (main.c)request_firmware -> (main.c)_request_firmware

drivers/base/firmware_loader/main.c

 

 修改打印输出

diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
index ca1031ebc431..26cb376dde7e 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -329,7 +329,7 @@ fw_get_filesystem_firmware(struct device *device, struct fw_priv *fw_priv)msize, id);if (rc) {if (rc == -ENOENT)
-                               dev_dbg(device, "loading %s failed with error %d\n",
+                               dev_err(device, "loading %s failed with error %d\n",path, rc);elsedev_warn(device, "loading %s failed with error %d\n",
[  323.565696] usb 6-1: loading /lib/firmware/updates/4.19.193/rtl8822cu_config failed with error -2
[  323.566573] usb 6-1: loading /lib/firmware/updates/rtl8822cu_config failed with error -2
[  323.567465] usb 6-1: loading /lib/firmware/4.19.193/rtl8822cu_config failed with error -2
[  323.568345] usb 6-1: loading /lib/firmware/rtl8822cu_config failed with error -2
[  323.569233] usb 6-1: Direct firmware load for rtl8822cu_config failed with error -2
[  323.570135] rtk_btusb: fw name is  rtl8822cu_fw
[  323.571071] usb 6-1: loading /lib/firmware/updates/4.19.193/rtl8822cu_fw failed with error -2
[  323.572035] usb 6-1: loading /lib/firmware/updates/rtl8822cu_fw failed with error -2
[  323.572968] usb 6-1: loading /lib/firmware/4.19.193/rtl8822cu_fw failed with error -2
[  323.573913] usb 6-1: loading /lib/firmware/rtl8822cu_fw failed with error -2
[  323.574837] usb 6-1: Direct firmware load for rtl8822cu_fw failed with error -2
[  323.575768] rtk_btusb: load firmware failed!
[  323.576682] rtk_btusb: Rtk patch end -1
[  323.577606] rtk_btusb: btusb_open failed

看了一下rtk_misc.c,8822CU和8822CE都使用相同的文件,文件路径跟rkwifibt.sh配置的不一样,改成上面打印出来的其中一个路径即可

@@ -92,10 +92,11 @@ endefdefine RKWIFIBT_REALTEK_BT_INSTALL$(INSTALL) -D -m 0755 $(@D)/realtek/rtk_hciattach/rtk_hciattach $(TARGET_DIR)/usr/bin/rtk_hciattach$(INSTALL) -D -m 0755 $(@D)/bin/$(RKWIFIBT_ARCH)/* $(TARGET_DIR)/usr/bin/
-    $(INSTALL) -D -m 0644 $(@D)/realtek/$(BR2_PACKAGE_RKWIFIBT_CHIPNAME)/* $(TARGET_DIR)/lib/firmware/rtlbt/
+    $(INSTALL) -D -m 0644 $(@D)/realtek/$(BR2_PACKAGE_RKWIFIBT_CHIPNAME)/* $(TARGET_DIR)/lib/firmware/-$(INSTALL) -D -m 0644 $(@D)/realtek/$(BR2_PACKAGE_RKWIFIBT_CHIPNAME)/mp_* $(TARGET_DIR)/lib/firmware/rtlbt/-$(INSTALL) -D -m 0644 $(@D)/realtek/$(BR2_PACKAGE_RKWIFIBT_CHIPNAME)/mp_* $(TARGET_DIR)/lib/firmware/$(INSTALL) -D -m 0755 $(@D)/bt_realtek* $(TARGET_DIR)/usr/bin/
+    $(INSTALL) -D -m 0644 $(@D)/../*/drivers/bluetooth/rtk_btusb.ko $(TARGET_DIR)/usr/lib/modules/rtk_btusb.ko$(INSTALL) -D -m 0644 $(@D)/realtek/bluetooth_uart_driver/hci_uart.ko $(TARGET_DIR)/usr/lib/modules/hci_uart.ko$(INSTALL) -D -m 0755 $(@D)/bt_load_rtk_firmware $(TARGET_DIR)/usr/bin/$(SED) 's/BT_TTY_DEV/\/dev\/$(BT_TTY_DEV)/g' $(TARGET_DIR)/usr/bin/bt_load_rtk_firmware
[root@rk3399:/]# insmod /usr/lib/modules/rtk_btusb.ko
[  692.608607] rtk_btusb: Realtek Bluetooth USB driver ver 3.1.32e1d0b.20210819-170430
[  692.609896] rtk_btcoex: rtk_btcoex_init: version: 1.2
[  692.611098] rtk_btcoex: create workqueue
[  692.613186] rtk_btcoex: alloc buffers 1792, 2432 for ev and l2
[  692.614518] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNu[rmoot@rk3399:/]# ber 0
[  692.615699] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[  692.616864] rtk_btusb: patch_add
[  692.617942] rtk_btusb: auto suspend is disabled
[  692.619058] rtk_btusb: pid = 0x3548
[  692.620123] rtk_btusb: patch_add: Reset gEVersion to 0xff
[  692.621273] rtk_btusb: set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
[  692.623014] rtk_btusb: btusb_probe: done
[  692.623093] rtk_btusb: btusb_open start
[  692.632470] usbcore: registered new interface driver rtk_btusb
[  692.632950] rtk_btusb: btusb_open hdev->promisc ==0
[  692.634778] rtk_btusb: download_patch start
[  692.635651] rtk_btusb: chip type value: 0x73
[  692.636499] rtk_btusb: HCI reset.
[  692.651303] rtk_btusb: read_ver_rsp->lmp_subver = 0x8822
[  692.652337] rtk_btusb: read_ver_rsp->hci_rev = 0xc
[  692.653348] rtk_btusb: patch_entry->lmp_sub = 0x8822
[  692.654427] rtk_btusb: load_firmware start
[  692.655448] rtk_btusb: lmp_version = 0x8822
[  692.656449] rtk_btusb: config filename rtl8822cu_config
[  692.663614] rtk_btusb: no bdaddr file /opt/bdaddr
[  692.664754] rtk_btusb: Origin cfg len 25
[  692.665812] rtk_btusb: 55 ab 23 87 13 00 0c 00 10 02 80 92 04 50 c5 ea
[  692.666874] rtk_btusb: 19 e1 1b fd af 5f 01 a4 0b
[  692.667961] rtk_btusb: New cfg len 25
[  692.668983] rtk_btusb: 55 ab 23 87 13 00 0c 00 10 02 80 92 04 50 c5 ea
[  692.670011] rtk_btusb: 19 e1 1b fd af 5f 01 a4 0b
[  692.671058] rtk_btusb: fw name is  rtl8822cu_fw
[  692.679225] rtk_btusb: This is not 8723a, use new patch style!
[  692.680312] rtk_btusb: rtk_get_eversion: gEVersion 255
[  692.683394] rtk_btusb: eversion->status = 0x0, eversion->version = 0x3
[  692.684532] rtk_btusb: load_firmware: New gEVersion 3
[  692.685635] rtk_btusb: rtk_get_fw_project_id: opcode 0, len 1, data 13
[  692.686739] rtk_btusb: lmp_version is 8822, project_id is 8822, match!
[  692.698717] rtk_btusb: fw_version = 0x59a25c4
[  692.700018] rtk_btusb: number_of_total_patch = 3
[  692.701266] rtk_btusb: chipID 4
[  692.702524] rtk_btusb: patch_length 0x7d08
[  692.703763] rtk_btusb: start_offset 0x00006380
[  692.705035] rtk_btusb: Svn version:    24075
[  692.706246] rtk_btusb: Coexistence: BTCOEX_20200529-1c1c
[  692.707499] rtk_btusb: buf_len = 0x7d21
[  692.709034] rtk_btusb: fw: exists, config file: exists
[  692.710301] rtk_btusb: load_firmware done
[  692.711667] rtk_btusb: download_data start
[  693.121714] rtk_btusb: download_data done
[  693.124905] rtk_btusb: HCI reset.
[  693.142502] rtk_btusb: read_ver_rsp->lmp_subver = 0x25c4
[  693.144100] rtk_btusb: read_ver_rsp->hci_rev = 0x59a
[  693.145624] rtk_btusb: patch_entry->lmp_sub = 0x8822
[  693.147149] rtk_btusb: Rtk patch end 0
[  693.148636] rtk_btusb: btusb_open set HCI_RUNNING
[  693.150149] rtk_btcoex: Open BTCOEX
[  693.151609] rtk_btusb: btusb_open end
[  693.158545] rtk_btcoex: BTCOEX hci_rev 0x059a
[  693.164533] rtk_btcoex: BTCOEX lmp_subver 0x25c4
[  693.208605] rtk_btusb: btusb_notify: hci0 evt 3
[  695.437425] rtk_btusb: btusb_flush add delay
[  695.450090] rtk_btusb: btusb_close
[  695.465659] rtk_btcoex: Close BTCOEX
[  695.466968] rtk_btcoex: -x[root@rk3399:/]# lsmod
Module                  Size  Used by    Tainted: G
rtk_btusb              57344  0
8822ce               3010560  0

5、蓝牙调试 

调试工具

  • hciconfig:配置蓝牙设备,用于打印设备信息和配置设备
  • hcitool:配置蓝牙连接,执行扫描等命令

5.1、hciconfig 

[root@rk3399:/]# hciconfig -a
hci0:   Type: Primary  Bus: USBBD Address: 48:E7:DA:0A:F3:3C  ACL MTU: 1021:5  SCO MTU: 255:11DOWNRX bytes:633 acl:0 sco:0 events:35 errors:0TX bytes:391 acl:0 sco:0 commands:35 errors:0Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3Link policy: RSWITCH HOLD SNIFF PARKLink mode: SLAVE ACCEPT

 加载驱动后,蓝牙默认关闭,可以使用hciconfig hci0 up启动

[root@rk3399:/]# hciconfig hci0 up
[ 1250.686993] rtk_btusb: btusb_open start
[ 1250.687874] rtk_btusb: btusb_open hdev->promisc ==0
[ 1250.688670] rtk_btusb: download_patch start
[ 1250.689440] rtk_btusb: chip type value: 0x73
[ 1250.690169] rtk_btusb: HCI reset.
[ 1250.705614] rtk_btusb: read_ver_rsp->lmp_subver = 0x25c4
[ 1250.706392] rtk_btusb: read_ver_rsp->hci_rev = 0x59a
[ 1250.707186] rtk_btusb: patch_entry->lmp_sub = 0x8822
[ 1250.707965] rtk_btusb: Firmware already exists
[ 1250.708712] rtk_btusb: Rtk patch end 1
[ 1250.709457] rtk_btusb: btusb_open set HCI_RUNNING
[ 1250.710292] rtk_btcoex: Open BTCOEX
[ 1250.711015] rtk_btusb: btusb_open end
[ 1250.715467] rtk_btcoex: BTCOEX hci_rev 0x059a
[ 1250.720139] rtk_btcoex: BTCOEX lmp_subver 0x25c4
[root@rk3399:/]# hciconfig -a
hci0:   Type: Primary  Bus: USBBD Address: 48:E7:DA:0A:F3:3C  ACL MTU: 1021:5  SCO MTU: 255:11UP RUNNINGRX bytes:1820 acl:0 sco:0 events:76 errors:0TX bytes:800 acl:0 sco:0 commands:76 errors:0Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3Link policy: RSWITCH HOLD SNIFF PARKLink mode: SLAVE ACCEPTName: 'RTK_BT_5.0'Class: 0x000000Service Classes: UnspecifiedDevice Class: Miscellaneous,
[11876.532603] rtk_btcoex: BT   HCI VeCrsioO:  (0xa)  Revision: 0x59aLMP Version: E (0xXa)  Subversion: 0x25c4Manufacturer : Realtek Semiconductor Corporation (93)

 如果手机端搜索不到设备,可以设置设备蓝牙模式(iscan或pscan)

[root@rk3399:/]# hciconfig hci0 iscan
[root@rk3399:/]# hciconfig
hci0:   Type: Primary  Bus: USBBD Address: 48:E7:DA:0A:F3:3C  ACL MTU: 1021:5  SCO MTU: 255:11UP RUNNING ISCANRX bytes:22809 acl:14 sco:0 events:221 errors:0TX bytes:1590 acl:17 sco:0 commands:98 errors:0

5.2、hcitool

[root@rk3399:/]# hcitool scan
Scanning ...
[  189.381718] rtk_btcoex: hci (periodic)inq start
[  199.630798] rtk_btcoex: inquiry complete98:DA:60:0B:B9:AE       HC-064C:4F:EE:19:18:BD       OnePlus 8 ProC0:B6:F9:95:9B:D7       USER-20231011IA
[root@rk3399:/]# l2ping 4C:4F:EE:19:18:BD
[11977.134637] rtk_btusb: btusb_notify: hci0 evt 1
[11977.138679] rtk_btcoex: hci create connection, start paging
[11980.087826] rtk_btcoex: connected, handle 0002, status 0x00
[11980.093526] rtk_btcoex: Page success
Ping: 4C:4F:EE:19:18:BD from 48:E7:DA:0A:F3:3C (data size 44) ...
44 bytes from 4C:4F:EE:19:18:BD id 0 time 48.66ms
44 bytes from 4C:4F:EE:19:18:BD id 1 time 44.69ms
44 bytes from 4C:4F:EE:19:18:BD id 2 time 46.50ms
44 bytes from 4C:4F:EE:19:18:BD id 3 time 77.84ms
44 bytes from 4C:4F:EE:19:18:BD id 4 time 237.98ms
44 bytes from 4C:4F:EE:19:18:BD id 5 time 74.79ms
44 bytes from 4C:4F:EE:19:18:BD id 6 time 90.38ms
44 bytes from 4C:4F:EE:19:18:BD id 7 time 74.80ms
44 bytes from 4C:4F:EE:19:18:BD id 8 time 60.13ms
^C9 sent, 9 received, 0% loss

 连接有问题

[root@rk3399:/]# hcitool cc 4C:4F:EE:19:18:BD
[  319.489796] rtk_btcoex: hci create connection, start paging
[  319.489922] rtk_btusb: btusb_notify: hci0 evt 1
[  320.565861] rtk_btcoex: connected, handle 0007, status 0x00
[root@rk3399:/]# [  320.572738] rtk_btcoex: Page success
[  322.745642] rtk_btcoex: HCI Disconnect, handle 0007, reason 0x13
[  322.826840] rtk_btcoex: disconn cmpl evt: status 0x00, handle 0007, reason 0x16
[  322.833969] rtk_btcoex: process disconn complete event.
[  322.872103] rtk_btusb: btusb_notify: hci0 evt 2

在网上找到如下方法:rfcomm connect hci0 <bdaddr>

5.3、使用bluetoothd调试

启动bluetoothd服务后,就可以直接使用命令了:scan on, scan off, show, devices, connect等 

[root@rk3399:/]# /usr/libexec/bluetooth/bluetoothd -d -C -n &
[root@rk3399:/]# bluetoothctl

 show(显示本设备信息),devices(显示搜索到的设备)

 pair <bdaddr>  # 配对设备

connect <bdaddr>  # 连接设备

Failed to connect: org.bluez.Error.NotAvailable 

在网上找到如下方法:rfcomm connect hci0 <bdaddr>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/635585.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

使用函数计算,数禾如何实现高效的数据处理?

作者&#xff1a;邱鑫鑫&#xff0c;王彬&#xff0c;牟柏旭 公司背景和业务 数禾科技以大数据和技术为驱动&#xff0c;为金融机构提供高效的智能零售金融解决方案&#xff0c;服务银行、信托、消费金融公司、保险、小贷公司等持牌金融机构&#xff0c;业务涵盖消费信贷、小…

菜鸟关于做前、后端的整理(html、js),以及疑问

涉及到后端的接口py&#xff0c;前端html和js 这三部分就按照如下格式放到server项目主路径下&#xff0c;这样后端机可以作为一个前端server main.pystaticmain.jsmain.htmlhtml 首先是html要设定网页的显示 <!DOCTYPE html> <html> <head><title>…

电力能源实景三维可视化合集,智慧电网数字孪生

电力能源是现代社会发展和运行的基石&#xff0c;渗透于工业、商业、农业、家庭生活等方方面面&#xff0c;它为经济、生活质量、环境保护和社会发展提供了巨大的机会和潜力。图扑软件应用自研 HT for Web 强大的渲染引擎&#xff0c;助力现代化的电力能源数字孪生场景&#xf…

【Vue】vue项目中Uncaught runtime errors:怎样关闭

vue项目中Uncaught runtime errors:怎样关闭 一、背景描述二、报错原因三、解决方案3.1 只显示错误信息不全屏覆盖3.2 取消全屏覆盖 四、参考资料 一、背景描述 项目本来运行的好好&#xff0c;换了个新的浏览器&#xff0c;新的Chrome浏览器版本号是116.0.5845.97&#xff08…

视频增强修复Topaz Video AI

Topaz Video AI是一款强大的视频增强软件&#xff0c;利用人工智能技术对数千个视频进行训练&#xff0c;结合多个输入视频的帧信息来提高素材的分辨率。该软件可将视频的分辨率提高到最高8K&#xff0c;并保持真实的细节和运动一致性。同时&#xff0c;它还能自动修复视频中的…

HCIA-HarmonyOS设备开发认证-序

序 最近涉及到HarmonyOS鸿蒙系统设备开发&#xff0c;在网络上已经有很多相关资料&#xff0c;视频教程&#xff0c;我也移植了公司的一个stm32G474板卡&#xff0c;运行LiteOS-m L0系统。 一面看资料一面移植&#xff0c;遇到不少坑&#xff0c;当看到运行的LOGO时&#xff0…

protobuf学习日记 | 认识protobuf中的类型

目录 前言 一、标量数据类型 二、protobuf中的 “数组” 三、特殊类型 1、枚举类型 &#xff08;1&#xff09;类型讲解 &#xff08;2&#xff09;升级通讯录 2、Any类型 &#xff08;1&#xff09;类型讲解 &#xff08;2&#xff09;升级通讯录 3、oneof类型 …

LeetCode、2300. 咒语和药水的成功对数【中等,排序+二分】

文章目录 前言LeetCode、2300. 咒语和药水的成功对数【中等&#xff0c;排序二分】题目及类型思路及代码 资料获取 前言 博主介绍&#xff1a;✌目前全网粉丝2W&#xff0c;csdn博客专家、Java领域优质创作者&#xff0c;博客之星、阿里云平台优质作者、专注于Java后端技术领域…

elementUI+el-upload 上传、下载、删除文件以及文件展示列表自定义为表格展示

Upload 上传组件的使用 官方文档链接使用el-upload组件上传文件 具体参数说明&#xff0c;如何实现上传、下载、删除等功能获取文件列表进行file-list格式匹配代码 文件展示列表自定义为表格展示 使用的具体参数说明文件大小展示问题&#xff08;KB/MB&#xff09;文件下载代码…

【GitHub项目推荐--微软开源的可视化工具】【转载】

说到数据可视化&#xff0c;大家都很熟悉了&#xff0c;设计师、数据分析师、数据科学家等&#xff0c;都需要用各种方式各种途径做着数据可视化的工作.....当然许多程序员在工作中有时也需要用到一些数据可视化工具&#xff0c;如果工具用得好&#xff0c;就可以把原本枯燥凌乱…

svg矢量图标在wpf中的使用

在wpf应用程序开发中&#xff0c;为支持图标的矢量缩放&#xff0c;及在不同分辨率下界面中图标元素的矢量无损缩放&#xff0c;所以常常用到svg图标&#xff0c;那么如果完 美的将svg图标运用到wpf日常的项目开发中呢&#xff0c;这里分享一下我的个人使用经验和详细步骤。 步…

二叉树的基础概念及遍历

二叉树(Binary Tree)的基础 1、树的概念 1、树的概念 树是一种非线性的数据结构&#xff0c;是由n&#xff08;n>0&#xff09;个有限结点组成一个具有层次关系的集合&#xff0c;将它称为树&#xff0c;是因为在形状上像一颗倒着的树&#xff0c;如下图所示就是一颗二叉…

electron-vite中的ipc通信

1. 概述 再electron中&#xff0c;进程间的通信通过ipcMain和ipcRenderer模块&#xff0c;这些通道是任意和双向的 1.1. 什么是上下文隔离进程 ipc通道是通过预加载脚本绑定到window对象的electron对象属性上的 2. 通信方式 2.1. ipcMain&#xff08;也就是渲染进程向主进…

R303 指纹识别模块硬件接口说明

1.外部接口尺寸图 2.USB通讯 3.串行通讯

VUE组件--动态组件、组件保持存活、异步组件

动态组件 有些场景可能会需要在多个组件之间进行来回切换&#xff0c;在vue中则使用<component :is"..."> 来实现组件间的来回切换 // App.vue <template><component :is"tabComponent"></component><button click"change…

【JavaEE进阶】 SpringBoot配置⽂件

文章目录 &#x1f340;配置⽂件的作⽤&#x1f334;SpringBoot配置⽂件&#x1f38b;配置⽂件的格式&#x1f384;properties配置⽂件&#x1f6a9;properties基本语法&#x1f6a9;读取配置⽂件&#x1f6a9;properties的缺点 &#x1f333;yml配置⽂件yml基本语法&#x1f6…

TestCaseAssiant使用说明

目录 说明 工具界面 功能描述 Xmind转测试用例 测试组件 测试用例 用例优先级 用例前提 用例操作步骤 用例期望结果 Excel测试用例转Testlink xml 用例模板 使用技巧: TestLink Xml转Excel测试用例 说明 本文为小编之前博文中介绍的工具使用说明 Xmind转Excel测…

python tkinter 最简洁的计算器按钮排列

代码如下&#xff0c;只要再加上按键绑定事件函数&#xff0c;计算器既可使用了。 import tkinter as tk from tkinter.ttk import Separator,Buttonif __name__ __main__:Buttons [[%,CE,C,←],[1/x,x,√x,],[7, 8, 9, x],[4, 5, 6, -],[1, 2, 3, ],[, 0, ., ]]root tk.T…

2024年阿里云优惠券和代金券领取,活动整理服务器价格表

2024阿里云优惠活动&#xff0c;免费领取阿里云优惠代金券&#xff0c;阿里云优惠活动大全和云服务器优惠价格表&#xff0c;阿里云ECS服务器优惠价99元一年起&#xff0c;轻量服务器优惠价61元一年&#xff0c;阿里云服务器网aliyunfuwuqi.com分享阿里云优惠券免费领取、优惠活…

GCC 内联汇编

LINUX下的汇编入门 AT&T风格 汇编 和GCC风格汇编 汇编代码的调试 前面写了三篇,是自我摸索三篇,摸着石头过河,有些或许是错误的细节,不必在意! 今天我们直接用GCC编译C语言代码,且在C语言里面内嵌AT&T风格的汇编! 前三篇大家了解即可,我们重点放在内嵌汇编里,简单快…