Hi All,
I am new to this bluetooth communication world. I need to communicate with a smart watch via bluetooth on raspberry Pi3. I am able to connect smart band with gatttool but if I tried to read data it is giving me error. The error command code is as per the manufacturer document. As per manufacturer document below are the service , TX and RX uuids.
Service UUID: 0xFFF0
Feature UUID:
TX UUID:0xFFF6
RX UUID:0xFFF7
As per my understanding TX uuid will help me to write command onto smart band and I will be able to read data from RX uuid.
Below are logs
---------------------------------
sudo hcitool lescan
LE Scan ...
DC:CB:35:FC:FB:3F (unknown)
DC:CB:35:FC:FB:3F Avia Touch FCFB3F
C5:12:95:DF:E5:8D (unknown)
C5:12:95:DF:E5:8D Kontakt
FB:5D:13:22:59:24 (unknown)
FB:5D:13:22:59:24 Kontakt
C5:2F:F0:F3:E7:BA (unknown)
C5:2F:F0:F3:E7:BA device 1
F2:D5:CA:8E:08:A4 (unknown)
F2:D5:CA:8E:08:A4 Kontakt
F4:B8:5E:BC:2E:AA (unknown)
F4:B8:5E:BC:2E:AA Sana
^Cpi@raspberrypi:~ $ sudo hcitool inq
Inquiring ...
B0:05:94:F5:FB:0C clock offset: 0x7f71 class: 0x3e010c
CC:AF:78:EF:51:DF clock offset: 0x4030 class: 0x3e010c
pi@raspberrypi:~ $ sudo hcidump
HCI sniffer - Bluetooth packet analyzer ver 5.41
device: hci0 snap_len: 1500 filter: 0xffffffff
^X^Cpi@raspberrypi:~ $ gatttool -I F4:B8:5E:BC:2E:AA
[ ][LE]> connect
Error: Remote Bluetooth address required
[ ][LE]> connect F4:B8:5E:BC:2E:AA
Attempting to connect to F4:B8:5E:BC:2E:AA
Error: connect error: Transport endpoint is not connected (107)
[F4:B8:5E:BC:2E:AA][LE]> connect F4:B8:5E:BC:2E:AA
Attempting to connect to F4:B8:5E:BC:2E:AA
Connection successful
[F4:B8:5E:BC:2E:AA][LE]> primary
attr handle: 0x0001, end grp handle: 0x000b 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: 0x0022 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle: 0x0023, end grp handle: 0xffff uuid: 0000fff0-0000-1000-8000-00805f9b34fb
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 0000fff0
[F4:B8:5E:BC:2E:AA][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: 00002a02-0000-1000-8000-00805f9b34fb
handle: 0x0008, char properties: 0x08, char value handle: 0x0009, uuid: 00002a03-0000-1000-8000-00805f9b34fb
handle: 0x000a, char properties: 0x02, char value handle: 0x000b, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x000d, char properties: 0x20, char value handle: 0x000e, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x0011, char properties: 0x02, char value handle: 0x0012, uuid: 00002a23-0000-1000-8000-00805f9b34fb
handle: 0x0013, char properties: 0x02, char value handle: 0x0014, uuid: 00002a24-0000-1000-8000-00805f9b34fb
handle: 0x0015, char properties: 0x02, char value handle: 0x0016, uuid: 00002a25-0000-1000-8000-00805f9b34fb
handle: 0x0017, char properties: 0x02, char value handle: 0x0018, uuid: 00002a26-0000-1000-8000-00805f9b34fb
handle: 0x0019, char properties: 0x02, char value handle: 0x001a, uuid: 00002a27-0000-1000-8000-00805f9b34fb
handle: 0x001b, char properties: 0x02, char value handle: 0x001c, uuid: 00002a28-0000-1000-8000-00805f9b34fb
handle: 0x001d, char properties: 0x02, char value handle: 0x001e, uuid: 00002a29-0000-1000-8000-00805f9b34fb
handle: 0x001f, char properties: 0x02, char value handle: 0x0020, uuid: 00002a2a-0000-1000-8000-00805f9b34fb
handle: 0x0021, char properties: 0x02, char value handle: 0x0022, uuid: 00002a50-0000-1000-8000-00805f9b34fb
handle: 0x0024, char properties: 0x0a, char value handle: 0x0025, uuid: 0000fff1-0000-1000-8000-00805f9b34fb
handle: 0x0026, char properties: 0x02, char value handle: 0x0027, uuid: 0000fff2-0000-1000-8000-00805f9b34fb
handle: 0x0028, char properties: 0x08, char value handle: 0x0029, uuid: 0000fff3-0000-1000-8000-00805f9b34fb
handle: 0x002a, char properties: 0x10, char value handle: 0x002b, uuid: 0000fff4-0000-1000-8000-00805f9b34fb
handle: 0x002d, char properties: 0x02, char value handle: 0x002e, uuid: 0000fff5-0000-1000-8000-00805f9b34fb
handle: 0x002f, char properties: 0x0a, char value handle: 0x0030, uuid: 0000fff6-0000-1000-8000-00805f9b34fb
handle: 0x0031, char properties: 0x10, char value handle: 0x0032, uuid: 0000fff7-0000-1000-8000-00805f9b34fb
[F4:B8:5E:BC:2E:AA][LE]> char-read-hnd 03
Characteristic value/descriptor: 53 61 6e 61
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x0030 0x41 // to read time
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 0000fff7-0000-1000-8000-00805f9b34fb
Error: Read characteristics by UUID failed: Attribute can't be read
[F4:B8:5E:BC:2E:AA][LE]> char-read-hnd 32
Error: Characteristic value/descriptor read failed: Attribute can't be read
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 30 41000000 00000000 00000000 00000041
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 2902
handle: 0x000f value: 00 00
handle: 0x002c value: 00 00
handle: 0x0033 value: 00 00
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x000f 03 00
Error: Characteristic Write Request failed: Attribute value length is invalid
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x000f 0300
Error: Characteristic Write Request failed: Internal application error: I/O
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x000f 0200
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 2902
handle: 0x000f value: 02 00
handle: 0x002c value: 00 00
handle: 0x0033 value: 00 00
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x002c 0300
Error: Characteristic Write Request failed: Internal application error: I/O
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x002c 0100
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x0033 0100
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 2902
handle: 0x000f value: 02 00
handle: 0x002c value: 01 00
handle: 0x0033 value: 01 00
[F4:B8:5E:BC:2E:AA][LE]> disconnect
[F4:B8:5E:BC:2E:AA][LE]> char-desc
Command Failed: Disconnected
[F4:B8:5E:BC:2E:AA][LE]> connect
Attempting to connect to F4:B8:5E:BC:2E:AA
Connection successful
[F4:B8:5E:BC:2E:AA][LE]> cahr-write-req 0x0030 41000000 00000000 00000000 00000041
Error: cahr-write-req: command not found
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x0030 41000000 00000000 00000000 00000041 // to read time
Characteristic value was written successfully
Notification handle = 0x0032 value: c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c1 // Giving me error as per document.
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 2902
handle: 0x000f value: 00 00
handle: 0x002c value: 01 00
handle: 0x0033 value: 01 00
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x00f 0100
Error: Characteristic Write Request failed: Internal application error: I/O
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x00f 0200
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x000f 0100
Error: Characteristic Write Request failed: Internal application error: I/O
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x000f 0200
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x002c 0300
Error: Characteristic Write Request failed: Internal application error: I/O
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x002c 0100
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x0033 0100
Characteristic value was written successfully
[F4:B8:5E:BC:2E:AA][LE]> char-write-req 0x0030 41000000 00000000 00000000 00000041 // Same
Characteristic value was written successfully
Notification handle = 0x0032 value: c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c1
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 2902
handle: 0x000f value: 02 00
handle: 0x002c value: 01 00
handle: 0x0033 value: 01 00
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid fff6
handle: 0x0030 value: 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid fff7
Error: Read characteristics by UUID failed: Attribute can't be read
[F4:B8:5E:BC:2E:AA][LE]> primary
attr handle: 0x0001, end grp handle: 0x000b 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: 0x0022 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle: 0x0023, end grp handle: 0xffff uuid: 0000fff0-0000-1000-8000-00805f9b34fb
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid oxffff
Error: Invalid UUID
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid oxffff0000fff0
Error: Invalid UUID
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 0000fff0
[F4:B8:5E:BC:2E:AA][LE]> char-read-hnd 0xffff
Error: Characteristic value/descriptor read failed: Invalid handle
[F4:B8:5E:BC:2E:AA][LE]> char-read-hnd 0x0023
Characteristic value/descriptor: f0 ff
[F4:B8:5E:BC:2E:AA][LE]> char-read-hnd f0 ff
Error: Characteristic value/descriptor read failed: Invalid handle
[F4:B8:5E:BC:2E:AA][LE]> char-desc f0 ff
Error: Discover descriptors failed: No attribute found within the given range
[F4:B8:5E:BC:2E:AA][LE]> char-read-hnd 0x0010
Characteristic value/descriptor: 0a 18
[F4:B8:5E:BC:2E:AA][LE]> char-desc 0a 18
handle: 0x000a, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000b, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x000c, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x000d, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000e, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x000f, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0010, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0011, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0012, uuid: 00002a23-0000-1000-8000-00805f9b34fb
handle: 0x0013, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0014, uuid: 00002a24-0000-1000-8000-00805f9b34fb
handle: 0x0015, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0016, uuid: 00002a25-0000-1000-8000-00805f9b34fb
handle: 0x0017, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0018, uuid: 00002a26-0000-1000-8000-00805f9b34fb
[F4:B8:5E:BC:2E:AA][LE]> char-read-uuid 0000180a
[F4:B8:5E:BC:2E:AA][LE]>
I will really appreciate if any help will be provided.
Thank you in anticipation,
Ankush