我正在尝试使用 Raspberry Pi 4 连接到 BLE 设备,但我无法连接,我使用的 BLE 设备是Minew B10 plus,我尝试使用 gatttool 和 bluetoothctl 但我无法连接到 BLE 设备在 gatttool 我得到这个:
pi@raspberrypi:~sudo gatttool -b AC:23:3F:AA:36:2C -I
[AC:23:3F:AA:36:2C][LE]> connect
Attempting to connect to AC:23:3F:AA:36:2C
Connection successful
(gatttool:1822): GLib-WARNING **: 11:25:11.113: Invalid file descriptor.
Command Failed: Disconnected
正如您最初看到的那样,我可以连接,但几秒钟后它就断开了。
使用 bluetoothctl 我得到了这个:
pi@raspberrypi:~ $ sudo bluetoothctl
Agent registered
[bluetooth]# scan on
Discovery started
[NEW] Device AC:23:3F:AA:36:2C AC-23-3F-AA-36-2C
[bluetooth]# connect AC:23:3F:AA:36:2C
Attempting to connect to AC:23:3F:AA:36:2C
[CHG] Device AC:23:3F:AA:36:2C Connected: yes
Connection successful
[NEW] Primary Service (Handle 0xbd8c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000a
00001801-0000-1000-8000-00805f9b34fb
Generic Attribute Profile
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000a/char000b
00002a05-0000-1000-8000-00805f9b34fb
Service Changed
[NEW] Descriptor (Handle 0x24fc)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000a/char000b/desc000d
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Primary Service (Handle 0xc30c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000e
0000180a-0000-1000-8000-00805f9b34fb
Device Information
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000e/char000f
00002a29-0000-1000-8000-00805f9b34fb
Manufacturer Name String
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000e/char0011
00002a24-0000-1000-8000-00805f9b34fb
Model Number String
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000e/char0013
00002a25-0000-1000-8000-00805f9b34fb
Serial Number String
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000e/char0015
00002a27-0000-1000-8000-00805f9b34fb
Hardware Revision String
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000e/char0017
00002a26-0000-1000-8000-00805f9b34fb
Firmware Revision String
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service000e/char0019
00002a28-0000-1000-8000-00805f9b34fb
Software Revision String
[NEW] Primary Service (Handle 0xd984)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001b
7f280001-8204-f393-e0a9-e50e24dcca9e
Vendor specific
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001b/char001c
7f280002-8204-f393-e0a9-e50e24dcca9e
Vendor specific
[NEW] Descriptor (Handle 0x24fc)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001b/char001c/desc001e
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Primary Service (Handle 0xe1a4)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001f
a3c87500-8ed3-4bdf-8a39-a01bebede295
Eddystone Configuration Service
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001f/char0020
a3c87501-8ed3-4bdf-8a39-a01bebede295
Capabilities
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001f/char0022
a3c87502-8ed3-4bdf-8a39-a01bebede295
Active Slot
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001f/char0024
a3c87503-8ed3-4bdf-8a39-a01bebede295
Advertising Interval
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001f/char0026
a3c87504-8ed3-4bdf-8a39-a01bebede295
Radio Tx Power
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001f/char0028
a3c87505-8ed3-4bdf-8a39-a01bebede295
(Advanced) Advertised Tx Power
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001f/char002a
a3c8750a-8ed3-4bdf-8a39-a01bebede295
ADV Slot Data
[NEW] Characteristic (Handle 0x006c)
/org/bluez/hci0/dev_AC_23_3F_AA_36_2C/service001f/char002c
a3c8750b-8ed3-4bdf-8a39-a01bebede295
(Advanced) Factory reset
[CHG] Device AC:23:3F:AA:36:2C UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device AC:23:3F:AA:36:2C UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device AC:23:3F:AA:36:2C UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device AC:23:3F:AA:36:2C UUIDs: 7f280001-8204-f393-e0a9-e50e24dcca9e
[CHG] Device AC:23:3F:AA:36:2C UUIDs: a3c87500-8ed3-4bdf-8a39-a01bebede295
[CHG] Device AC:23:3F:AA:36:2C ServicesResolved: yes
[CHG] Device AC:23:3F:AA:36:2C Name: nRF5x
[CHG] Device AC:23:3F:AA:36:2C Alias: nRF5x
[CHG] Device AC:23:3F:AA:36:2C ServicesResolved: no
[CHG] Device AC:23:3F:AA:36:2C Connected: no
最初它再次连接,但后来它断开连接
蓝牙服务是:
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-02-18 11:24:44 GMT; 10min ago
Docs: man:bluetoothd(8)
Main PID: 1792 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 4915)
CPU: 187ms
CGroup: /system.slice/bluetooth.service
└─1792 /usr/libexec/bluetooth/bluetoothd --noplugin=sap
Feb 18 11:24:44 raspberrypi bluetoothd[1792]: Bluetooth daemon 5.55
Feb 18 11:24:44 raspberrypi bluetoothd[1792]: src/main.c:check_options() Unknown key EnableLE for group Polic>
Feb 18 11:24:44 raspberrypi bluetoothd[1792]: src/main.c:check_options() Unknown key AttributeServer for grou>
Feb 18 11:24:44 raspberrypi systemd[1]: Started Bluetooth service.
Feb 18 11:24:44 raspberrypi bluetoothd[1792]: Starting SDP server
Feb 18 11:24:44 raspberrypi bluetoothd[1792]: Excluding (cli) sap
Feb 18 11:24:44 raspberrypi bluetoothd[1792]: Bluetooth management interface 1.18 initialized
Feb 18 11:24:44 raspberrypi bluetoothd[1792]: Failed to set privacy: Rejected (0x0b)
Feb 18 11:24:45 raspberrypi bluetoothd[1792]: Endpoint registered: sender=:1.29 path=/MediaEndpoint/A2DPSink/>
Feb 18 11:24:45 raspberrypi bluetoothd[1792]: Endpoint registered: sender=:1.29 path=/MediaEndpoint/A2DPSourc>
[1]: https://www.minew.com/product/b10-emergency-button/
这里显示无法设置隐私
所以这些都是需要解决的错误。