Closed mrquincle closed 4 years ago
Mmm, let me think about more debug info. I've set my device to use auth
and encrypt
.
sudo hciconfig -a
hci0: Type: Primary Bus: USB
BD Address: A4:34:D9:86:C2:79 ACL MTU: 1021:4 SCO MTU: 96:6
UP RUNNING PSCAN AUTH ENCRYPT
RX bytes:103341 acl:627 sco:0 events:11456 errors:0
TX bytes:9157201 acl:10928 sco:0 commands:70 errors:0
Features: 0xbf 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'ChromeLinux_6F32'
Class: 0x0c010c
Service Classes: Rendering, Capturing
Device Class: Computer, Laptop
HCI Version: 4.2 (0x8) Revision: 0x100
LMP Version: 4.2 (0x8) Subversion: 0x100
Manufacturer: Intel Corp. (2)
If I run wireshark I see:
7702 remote () 86.032089 localhost () ATT 14 Rcvd Error Response - Insufficient Encryption, Handle: 0x002e (Unknown)
7703 localhost () 86.032563 remote () ATT 12 Sent Read Request, Handle: 0x002e (Unknown)
Not sure where it fails. From here I read it might not be using the long-term key from bluetoothctl
.
Denotes that the link is not encrypted but a suitable LTK is available
Using something like:
bluetoothctl
scan on
connect f3:3c:2f:92:78:8d
scan off
pair
menu gatt
select-attribute 932c32bd-0002-47a2-835a-a8d455b859dd
read
Yes. It still works, just tested. I remember I had to do a reset on the phone at some point the same way you described. I don't have gattool or hciconfig, which means that my bluez is slightly newer (5.54).
I tried to pair with iOS/watchOS and this also did not work out using my own self-written apps. I also got an error like Insufficient Encryption
. However wireshark is a good call, I will see if I can get this to work/debug it with it.
This is my output of bluetoothctl:
[bluetooth]# info D4:BB:D8:6C:07:86
Device D4:BB:D8:6C:07:86 (random)
Name: Hue Lamp
Alias: Hue Lamp
Paired: yes
Trusted: no
Blocked: no
Connected: no
LegacyPairing: no
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
UUID: Unknown (0000fe0f-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (932c32bd-0000-47a2-835a-a8d455b859dd)
UUID: Vendor specific (9da2ddf1-0000-44d0-909c-3f3d3cb34a7b)
UUID: Vendor specific (b8843add-0000-4aa1-8794-c3f462030bda)
I also have 1.65.9_hB3217DF4
Interesting... I'll try to cycle a few more times through the factory reset to see if that helps. What's your hci device like?
Regarding bluez
version, good one. bluetoothd --version
gives 5.48
. I'll update my OS. :-)
[ 21.240424] Bluetooth: Core ver 2.22
[ 21.240436] Bluetooth: HCI device and connection manager initialized
[ 21.240440] Bluetooth: HCI socket layer initialized
[ 21.240442] Bluetooth: L2CAP socket layer initialized
[ 21.240444] Bluetooth: SCO socket layer initialized
[ 21.352149] Bluetooth: hci0: using rampatch file: qca/rampatch_usb_00000302.bin
[ 21.352151] Bluetooth: hci0: QCA: patch rome 0x302 build 0x3e8, firmware rome 0x302 build 0x111
[ 21.406703] Bluetooth: hci0: using NVM file: qca/nvm_usb_00000302.bin
[ 22.198051] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 22.198055] Bluetooth: BNEP socket layer initialized
[ 30.041185] Bluetooth: RFCOMM TTY layer initialized
[ 30.041191] Bluetooth: RFCOMM socket layer initialized
[ 30.041197] Bluetooth: RFCOMM ver 1.11
[29195.779801] Bluetooth: hci0: using rampatch file: qca/rampatch_usb_00000302.bin
[29195.779803] Bluetooth: hci0: QCA: patch rome 0x302 build 0x3e8, firmware rome 0x302 build 0x111
[29195.845170] Bluetooth: hci0: using NVM file: qca/nvm_usb_00000302.bin
Update my OS. I'm now at 5.53
. Still not much luck though.
connect to F3:3C:2F:92:78:8D...
found brightness characteristics
found light characteristics
service: 9da2ddf1-0000-44d0-909c-3f3d3cb34a7b
characteristic: 9da2ddf1-0001-44d0-909c-3f3d3cb34a7b: None
service: b8843add-0000-4aa1-8794-c3f462030bda
characteristic: b8843add-0004-4aa1-8794-c3f462030bda: None
characteristic: b8843add-0003-4aa1-8794-c3f462030bda: None
characteristic: b8843add-0002-4aa1-8794-c3f462030bda: None
characteristic: b8843add-0001-4aa1-8794-c3f462030bda: None
service: 932c32bd-0000-47a2-835a-a8d455b859dd
characteristic: 932c32bd-1005-47a2-835a-a8d455b859dd: None
characteristic: 932c32bd-0007-47a2-835a-a8d455b859dd: None
characteristic: 932c32bd-0006-47a2-835a-a8d455b859dd: None
characteristic: 932c32bd-0003-47a2-835a-a8d455b859dd: None
characteristic: 932c32bd-0002-47a2-835a-a8d455b859dd: None
characteristic: 932c32bd-0001-47a2-835a-a8d455b859dd: None
service: 0000fe0f-0000-1000-8000-00805f9b34fb
characteristic: 97fe6561-a001-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-2004-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-2002-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-2001-4f62-86e9-b71ee2da3d22:
characteristic: 97fe6561-1001-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-0008-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-0004-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-0003-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-0001-4f62-86e9-b71ee2da3d22: bytearray(b'\xf4\x84\xd3\x06\x01\x88\x17\x00')
service: 0000180a-0000-1000-8000-00805f9b34fb
characteristic: 00002a28-0000-1000-8000-00805f9b34fb: 1.65.9_hB3217DF4
characteristic: 00002a24-0000-1000-8000-00805f9b34fb: LWA001
characteristic: 00002a29-0000-1000-8000-00805f9b34fb: Philips
service: 00001801-0000-1000-8000-00805f9b34fb
characteristic: 00002b29-0000-1000-8000-00805f9b34fb:
characteristic: 00002b2a-0000-1000-8000-00805f9b34fb: bytearray(b'a\x10;o5\xdc\xcd\xb0{$\xa1\xc6\xd8\x04\xb3\xb1')
characteristic: 00002a05-0000-1000-8000-00805f9b34fb: None
It works! I think I've done it now for the 10th time (the factory reset), but now it worked! :-)
Proof:
./hue-ble-ctl.py introspect 'F6:9B:C8:D5:EF:C3'
connect to F6:9B:C8:D5:EF:C3...
found brightness characteristics
found light characteristics
service: 9da2ddf1-0000-44d0-909c-3f3d3cb34a7b
characteristic: 9da2ddf1-0001-44d0-909c-3f3d3cb34a7b: None
service: b8843add-0000-4aa1-8794-c3f462030bda
characteristic: b8843add-0004-4aa1-8794-c3f462030bda:
characteristic: b8843add-0003-4aa1-8794-c3f462030bda: None
characteristic: b8843add-0002-4aa1-8794-c3f462030bda: None
characteristic: b8843add-0001-4aa1-8794-c3f462030bda: bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00')
service: 932c32bd-0000-47a2-835a-a8d455b859dd
characteristic: 932c32bd-1005-47a2-835a-a8d455b859dd: bytearray(b'\x01\x01\x01\x02\x01\xfe')
characteristic: 932c32bd-0007-47a2-835a-a8d455b859dd: bytearray(b'\x01\x01\x00\x02\x01\xfe')
characteristic: 932c32bd-0006-47a2-835a-a8d455b859dd: None
characteristic: 932c32bd-0003-47a2-835a-a8d455b859dd: bytearray(b'\xfe')
characteristic: 932c32bd-0002-47a2-835a-a8d455b859dd:
characteristic: 932c32bd-0001-47a2-835a-a8d455b859dd:
service: 0000fe0f-0000-1000-8000-00805f9b34fb
characteristic: 97fe6561-a001-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-2004-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-2002-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-2001-4f62-86e9-b71ee2da3d22:
characteristic: 97fe6561-1001-4f62-86e9-b71ee2da3d22:
characteristic: 97fe6561-0008-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-0004-4f62-86e9-b71ee2da3d22: None
characteristic: 97fe6561-0003-4f62-86e9-b71ee2da3d22: Hue bulb
characteristic: 97fe6561-0001-4f62-86e9-b71ee2da3d22: bytearray(b'\xf4\x84\xd3\x06\x01\x88\x17\x00')
service: 0000180a-0000-1000-8000-00805f9b34fb
characteristic: 00002a28-0000-1000-8000-00805f9b34fb: 1.65.9_hB3217DF4
characteristic: 00002a24-0000-1000-8000-00805f9b34fb: LWA001
characteristic: 00002a29-0000-1000-8000-00805f9b34fb: Philips
service: 00001801-0000-1000-8000-00805f9b34fb
characteristic: 00002b29-0000-1000-8000-00805f9b34fb:
characteristic: 00002b2a-0000-1000-8000-00805f9b34fb: bytearray(b'a\x10;o5\xdc\xcd\xb0{$\xa1\xc6\xd8\x04\xb3\xb1')
characteristic: 00002a05-0000-1000-8000-00805f9b34fb: None
I'm a happy camper!
I am having the same problem and have tried resetting multiple times. It also takes like 5-10 seconds to attempt to fetch each of the characteristics before it writes 'None'.
I am on bluez 5.50, trying to connect from a Raspberry Pi Zero W.
The software running on the Philips Hue I have has version
1.65_9_hB3217DF4
.If I run something like
gatttool -l low -t random -b f6:4a:25:26:22:91 --characteristics
it looks that I've the same characteristics as you do.If I run your script in both situations I get only
None
on the introspection. It does connect, although that's also a bit flaky.The on/off characteristic seems indeed similar.
handle = 0x002d, char properties = 0x1e, char value handle = 0x002e, uuid = 932c32bd-0002-47a2-835a-a8d455b859dd
Writing to the
char value handle 0x002e
No result... Neither with
char-write-req
.Ah, the result of your script. It didn't matter for me if it is the above MAC address or the address after clicking Reset in the Philips Hue app (see below):
Or is there a more thorough factory reset possible?