我一直在尝试将FitBit Inspire HR和RENPHO ES-26R 体重秤与我的 Raspberry Pi(3B+、4B 和零)配对,结果都相同。运行bluetoothctl (v5.50),可以看到设备(ED:67是规模,01:C5是 Fitbit):
...
[CHG] Device ED:67:37:60:78:22 ManufacturerData Key: 0xffff
[CHG] Device ED:67:37:60:78:22 ManufacturerData Value:
aa bb ed 67 37 60 78 22 00 01 23 14 ff ff ff 14 ...g7`x"..#.....
00 6a 04 4d a2 02 1d 0c .j.M....
[CHG] Device 01:C5:59:47:49:F9 RSSI: -47
[CHG] Device 01:C5:59:47:49:F9 TxPower: 3
...
规模
当我尝试配对或连接秤时,bluetoothctl、hcidump 和 gatttool 的输出如下:
蓝牙控制
Attempting to pair with ED:67:37:60:78:22
Failed to pair: org.bluez.Error.AuthenticationCanceled
hcidump
> HCI Event: Command Complete (0x0e) plen 4
LE Remove Device From White List (0x08|0x0012) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Add Device To White List (0x08|0x0011) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Parameters (0x08|0x000b) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Enable (0x08|0x000c) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Enable (0x08|0x000c) ncmd 1
status 0x00
加特工具
> sudo gatttool -b ED:67:37:60:78:22 -I
[ED:67:37:60:78:22][LE]> connect
Attempting to connect to ED:67:37:60:78:22
Error: connect error: Connection refused (111)
根据我看到的几个线程,我尝试使用公共和随机的地址类型,没有任何变化。hcidump 似乎对 Scale 没有太多影响。
编辑
进一步检查秤,它似乎不是“可连接的”。鉴于没有明确的服务或特征,我开始查看广告中的“制造数据” 。我可以看到,随着尺度上的测量值发生变化,部分数据也在发生变化:
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4d 7f 7e 3a 14 00 00 00 4d a2 02 8a 25
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4d 7f 7e 3a 14 00 d2 00 4d a2 02 8b 25
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4d 7f 7e 3a 14 00 d2 00 4d a2 02 8b 25
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4d 7f 7e 3a 14 00 60 04 4d a2 02 8b 25
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4d 7f 7e 3a 14 00 68 06 4d a2 02 8b 25
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4d 7f 7e 3a 14 00 68 06 4d a2 02 8b 25
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4d 7f 7e 3a 14 00 ad 07 4d a2 02 8c 25
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4d 7f 7e 3a 14 00 ad 07 4d a2 02 8c 25
ff ff aa bb ed 67 37 60 78 22 5e 94 d7 4e 7f 7e 3a 14 00 6b 08 4d a2 02 8c 25
现在我只需要确认更新的部分实际上是重量数据——一旦我弄清楚汤里有什么(例如,计量单位、重量等)。
FITBIT
对于 Fitbit,有更多的输出,但配对仍然失败:
蓝牙控制
pair 01:C5:59:47:49:F9
Attempting to pair with 01:C5:59:47:49:F9
[CHG] Device 01:C5:59:47:49:F9 Connected: yes
[CHG] Device 01:C5:59:47:49:F9 ServicesResolved: yes
[CHG] Device 01:C5:59:47:49:F9 ServicesResolved: no
[CHG] Device 01:C5:59:47:49:F9 Connected: no
Failed to pair: org.bluez.Error.AuthenticationCanceled
hcidump
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Parameters (0x08|0x000b) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Enable (0x08|0x000c) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Enable (0x08|0x000c) ncmd 1
status 0x00
> HCI Event: Command Status (0x0f) plen 4
LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
> HCI Event: Command Status (0x0f) plen 4
LE Read Remote Used Features (0x08|0x0016) status 0x00 ncmd 1
> HCI Event: Command Complete (0x0e) plen 14
LE Read Remote Used Features (0x08|0x0016) ncmd 1
> HCI Event: Command Status (0x0f) plen 4
Disconnect (0x01|0x0006) status 0x00 ncmd 1
> HCI Event: Disconn Complete (0x05) plen 4
status 0x00 handle 64 reason 0x16
Reason: Connection Terminated by Local Host
加特工具
与 Scale 不同,我可以使用 gatttool 连接到 Fitbit 并检索特征:
[01:C5:59:47:49:F9][LE]> connect
Attempting to connect to 01:C5:59:47:49:F9
Connection successful
[01:C5:59:47:49:F9][LE]> characteristics
handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x0008, char properties: 0x02, char value handle: 0x0009, uuid: 00002aa6-0000-1000-8000-00805f9b34fb
handle: 0x000b, char properties: 0x20, char value handle: 0x000c, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x000f, char properties: 0x02, char value handle: 0x0010, uuid: adabfb04-6e7d-4601-bda2-bffaa68956ba
handle: 0x0011, char properties: 0x06, char value handle: 0x0012, uuid: adabfb02-6e7d-4601-bda2-bffaa68956ba
handle: 0x0013, char properties: 0x12, char value handle: 0x0014, uuid: adabfb03-6e7d-4601-bda2-bffaa68956ba
handle: 0x0016, char properties: 0x10, char value handle: 0x0017, uuid: adabfb01-6e7d-4601-bda2-bffaa68956ba
handle: 0x0019, char properties: 0x20, char value handle: 0x001a, uuid: adabfb05-6e7d-4601-bda2-bffaa68956ba
handle: 0x001d, char properties: 0x12, char value handle: 0x001e, uuid: 558dfa01-4fa8-4105-9f02-4eaa93e62980
handle: 0x0021, char properties: 0x02, char value handle: 0x0022, uuid: 00002a29-0000-1000-8000-00805f9b34fb
handle: 0x0023, char properties: 0x02, char value handle: 0x0024, uuid: 00002a24-0000-1000-8000-00805f9b34fb
handle: 0x0025, char properties: 0x02, char value handle: 0x0026, uuid: 00002a25-0000-1000-8000-00805f9b34fb
handle: 0x0027, char properties: 0x02, char value handle: 0x0028, uuid: 00002a27-0000-1000-8000-00805f9b34fb
handle: 0x0029, char properties: 0x02, char value handle: 0x002a, uuid: 00002a26-0000-1000-8000-00805f9b34fb
handle: 0x002b, char properties: 0x02, char value handle: 0x002c, uuid: 00002a28-0000-1000-8000-00805f9b34fb
handle: 0x002d, char properties: 0x02, char value handle: 0x002e, uuid: 00002a23-0000-1000-8000-00805f9b34fb
handle: 0x002f, char properties: 0x02, char value handle: 0x0030, uuid: 00002a2a-0000-1000-8000-00805f9b34fb
handle: 0x0031, char properties: 0x02, char value handle: 0x0032, uuid: 00002a50-0000-1000-8000-00805f9b34fb
附加信息
蓝牙服务状态
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-04-09 18:32:27 BST; 24min ago
Docs: man:bluetoothd(8)
Main PID: 5515 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 4915)
Memory: 1.1M
CGroup: /system.slice/bluetooth.service
└─5515 /usr/lib/bluetooth/bluetoothd --compat --noplugin=sap -E
Apr 09 18:32:27 archer systemd[1]: Starting Bluetooth service...
Apr 09 18:32:27 archer bluetoothd[5515]: Bluetooth daemon 5.50
Apr 09 18:32:27 archer systemd[1]: Started Bluetooth service.
Apr 09 18:32:27 archer bluetoothd[5515]: Excluding (cli) sap
Apr 09 18:32:27 archer bluetoothd[5515]: Bluetooth management interface 1.14 initialized
dmesg | grep 蓝牙
[ 12.451287] Bluetooth: Core ver 2.22
[ 12.451337] Bluetooth: HCI device and connection manager initialized
[ 12.452111] Bluetooth: HCI socket layer initialized
[ 12.452123] Bluetooth: L2CAP socket layer initialized
[ 12.452151] Bluetooth: SCO socket layer initialized
[ 12.462111] Bluetooth: HCI UART driver ver 2.3
[ 12.462118] Bluetooth: HCI UART protocol H4 registered
[ 12.462172] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 12.462284] Bluetooth: HCI UART protocol Broadcom registered
[ 12.677032] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 12.677038] Bluetooth: BNEP filters: protocol multicast
[ 12.677048] Bluetooth: BNEP socket layer initialized
[ 818.140511] Bluetooth: RFCOMM TTY layer initialized
[ 818.140529] Bluetooth: RFCOMM socket layer initialized
[ 818.140542] Bluetooth: RFCOMM ver 1.11
联系
WiFi 和蓝牙在所有 PI 上都处于活动状态,我通过 SSH 连接。
结束
我一直在浏览来自多个论坛的许多线程,并进行了各种推荐的配置更改(保持 PI 3B+ 干净作为控件),但没有成功。我非常感谢任何关于下一步去哪里的建议或指示。一定是我在某处遗漏了一些东西——很可能是一些简单的东西让你们中的大多数人像以前从未笑过一样大笑:)
感谢您花时间阅读这个冗长的问题。