Fun with BLE - Command Line
hcitool & gatttool
Find all of the devices sending advertisements nearby:
$ sudo hcitool lescan
LE Scan ...
66:EA:DA:00:26:6F (unknown)
66:EA:DA:00:26:6F LUCI
10:0F:89:B2:80:F7 (unknown)
D0:26:0D:67:8A:60 (unknown)
EA:D8:D1:B3:07:11 (unknown)
CD:23:0A:64:87:5D (unknown)
CD:23:0A:64:87:5D (unknown)
66:EA:DA:00:0F:2B LUCI-66EADA000F2B
66:EA:DA:00:0F:2B (unknown)
C0:05:04:03:02:01 (unknown)Once you've selected your target, you can check out all of the services:
$ sudo gatttool -b 66:EA:DA:00:0F:2B --primary
attr handle = 0x0001, end grp handle = 0x0009 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle = 0x000c, end grp handle = 0x000f uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle = 0x0010, end grp handle = 0x0016 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle = 0x0017, end grp handle = 0x0024 uuid: 0000fef5-0000-1000-8000-00805f9b34fb
attr handle = 0x0025, end grp handle = 0x003a uuid: e4490001-60c7-4baa-818d-235695a2757f
attr handle = 0x003b, end grp handle = 0x003e uuid: 4179fd5d-ba39-4a8a-9305-dc1b3a493c41
attr handle = 0x003f, end grp handle = 0x0042 uuid: 00001805-0000-1000-8000-00805f9b34fbAnd then the characteristics:
And, we can see a list of the descriptors:
Let's choose a characteristic and read it's value. 2a26 is the Device Information Firmware Revision String characteristic. The "short version" 4 characters are the 5th-8th bytes of the UUID. We can query this characteristic by using its "char value handle" - 0x0012 in this case. And, we can see our firmware version.

Can we change the version? How do we write to the char?
Nope. Let's try something else. I've been looking at this device for a while, and the app apk indicates that 02 indicates whether the device is awake and 03 controls the brightness. So, we can grep for the end part of the service UUID to find all characteristics that match and find the 02 and 03 chars.
Looking at the output, it looks like there's some sort of 3 byte preamble (00 09 06) followed by a 3 byte value. If the 02 char is actually an awake indicator, maybe we can turn it on and off.
Success. (disclaimer: This didn't actually turn off the light)
Last updated
Was this helpful?