19. bluetooth

Video introduction to this chapter:

../../../_images/video.png

“15-Wireless Network Card Connecting WiFi and Bluetooth”

https://www.bilibili.com/video/BV1Y24y1A7xH/

Only the following models of LubanCat-RK series boards support Bluetooth function.

  • LubanCat-Zero-W

  • LubanCat-1N

If you want your board to have bluetooth capability, you can plug in a bluetooth adapter, or a wireless network card that supports both bluetooth and wifi. The following USB network cards can be plugged and played.

  • RTL8821CU

  • RTL8822BU

If other network cards are encountered, they cannot be recognized or used after insertion, and the kernel needs to be modified or the driver transplanted.

19.1. Desktop system configuration wifi

The default bluetooth is on, click on the bluetooth icon.

未找到图片08|

Click Devices

未找到图片08|

Click Trust Device first, then click Pairing, there will be a pairing pop-up window in the upper right corner, click Allow Pairing.

未找到图片08|

After the pairing is successful, the device needs to be connected. Right click and select the first option to connect the device.

未找到图片08|

After the connection is successful, there will be a connection logo on the right side of the device, and it will automatically connect to your device when you turn on the device next time. If you are connected to a Bluetooth headset, you can turn on the music player.

未找到图片08|

19.2. Configure Bluetooth from the command line

To configure Bluetooth using the command line, we need to use the tool—-bluetoothctl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Enter the bluetoothctl command line
bluetoothctl
# After entering the bluetoothctl command line, similar to: [bluetooth]#
# Controller represents the Bluetooth device on the arm board, and Device represents the Bluetooth headset
# Follow the steps below to initialize the Bluetooth device and connect the Bluetooth headset
# View help groups
help

power on
agent on
default-agent
# Start scan
scan on
# If the Bluetooth headset address is: 04:8C:9A:F2:54:4B
trust 04:8C:9A:F2:54:4B
# Pair
pair 04:8C:9A:F2:54:4B
# Connect
connect 04:8C:9A:F2:54:4B

# View Bluetooth headset information
info 04:8C:9A:F2:54:4B

# Disconnect
disconnect 04:8C:9A:F2:54:4B
# If you don't want to automatically connect to the Bluetooth headset, you can delete the pairing information.
remove 04:8C:9A:F2:54:4B

For more information about command line Bluetooth connection, please refer to https://blog.csdn.net/chenjk10/article/details/90317028