Skip to first unread message

Carlos Bieberach

unread,
Oct 20, 2018, 9:30:29 AM10/20/18
to MIT App Inventor Forum
Hello. Can somebody please guide me to where to start playing with BLE. Any post with an example or an extension I can start reading and testing.

I have the BLE device, it is a thermometer.

I would like to catch the temperature the device sends out but I don't even know how to establish the connection.

Thank you in advance,

Charles

Chris Ward

unread,
Oct 20, 2018, 11:06:10 AM10/20/18
to MIT App Inventor Forum
Hello Carlos

You may need a microcontroller. Can you post a link to the manufacturer's website that gives technical information about the thermometer?

For general info about App Inventor and electronics, see these links on my website: https://www.professorcad.co.uk/appinventortips#TipsLinks

Chris Ward

unread,
Oct 23, 2018, 10:41:26 PM10/23/18
to MIT App Inventor Forum
Hello Carlos

Please update this Post, do not email us directly.

You have sent an email but I'm sorry, we do not respond to direct communications.

This is because, by keeping the discussion on the forum, there are many people from all around the World (different time zones) who can potentially help you, not just the first responder, who may be unavailable. Plus, there is often something that many forum members can learn by reading the posts.

Carlos Bieberach

unread,
Oct 23, 2018, 10:56:35 PM10/23/18
to MIT App Inventor Forum
Hello,
I was able to catch this data with another App i downloaded. I dont know if the temperature shows in this log but i think i see battery level.

can i accomplish this with App inventor and its BLE extension ? 

nRF Connect, 2018-06-04
TAIDOC TD1261 (C0:26:DF:00:BC:F7)
V 18:08:54.295 Connecting to C0:26:DF:00:BC:F7...
D 18:08:54.295 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) (hidden)
D 18:08:59.413 [Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
E 18:08:59.414 Error 133 (0x85): GATT ERROR
I 18:08:59.414 Disconnected
D 18:09:47.394 gatt.close()
D 18:09:47.421 wait(200)
V 18:09:47.638 Connecting to C0:26:DF:00:BC:F7...
D 18:09:47.638 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) (hidden)
D 18:09:48.130 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 18:09:48.130 Connected to C0:26:DF:00:BC:F7
D 18:09:48.134 wait(1600ms)
D 18:09:48.171 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
V 18:09:49.744 Discovering services...
D 18:09:49.744 gatt.discoverServices()
D 18:09:49.776 [Callback] Services discovered with status: 0
I 18:09:49.776 Services discovered
V 18:09:49.824 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Health Thermometer (0x1809)
- Temperature Measurement [I] (0x2A1C)
   Client Characteristic Configuration (0x2902)
Battery Service (0x180F)
- Battery Level [N R] (0x2A19)
   Client Characteristic Configuration (0x2902)
Device Information (0x180A)
- Model Number String [R] (0x2A24)
- Firmware Revision String [R] (0x2A26)
Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
- Button [I N W] (00001524-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
D 18:09:49.824 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 18:09:49.827 gatt.setCharacteristicNotification(00002a1c-0000-1000-8000-00805f9b34fb, true)
D 18:09:49.830 gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
D 18:09:49.832 gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
V 18:11:08.971 Reading all characteristics...
V 18:11:08.971 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 18:11:08.971 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
I 18:11:09.155 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
A 18:11:09.155 "TAIDOC TD1261" received
V 18:11:09.155 Reading characteristic 00002a01-0000-1000-8000-00805f9b34fb
D 18:11:09.155 gatt.readCharacteristic(00002a01-0000-1000-8000-00805f9b34fb)
V 18:11:09.353 Reading characteristic 00002a04-0000-1000-8000-00805f9b34fb
D 18:11:09.353 gatt.readCharacteristic(00002a04-0000-1000-8000-00805f9b34fb)
I 18:11:09.357 Read Response received from 00002a01-0000-1000-8000-00805f9b34fb, value: (0x) 00-03
A 18:11:09.357 "[768] Generic Thermometer (Generic category)" received
V 18:11:09.555 Reading characteristic 00002a19-0000-1000-8000-00805f9b34fb
D 18:11:09.555 gatt.readCharacteristic(00002a19-0000-1000-8000-00805f9b34fb)
I 18:11:09.555 Read Response received from 00002a04-0000-1000-8000-00805f9b34fb, value: (0x) 28-00-50-00-00-00-90-01
A 18:11:09.555 "Connection Interval: 50.00ms - 100.00ms,
Slave Latency: 0,
Supervision Timeout Multiplier: 400" received
V 18:11:09.752 Reading characteristic 00002a24-0000-1000-8000-00805f9b34fb
D 18:11:09.752 gatt.readCharacteristic(00002a24-0000-1000-8000-00805f9b34fb)
I 18:11:09.753 Read Response received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 5C, "\"
A 18:11:09.753 "92%" received
V 18:11:09.952 Reading characteristic 00002a26-0000-1000-8000-00805f9b34fb
D 18:11:09.952 gatt.readCharacteristic(00002a26-0000-1000-8000-00805f9b34fb)
I 18:11:09.952 Read Response received from 00002a24-0000-1000-8000-00805f9b34fb, value: (0x) 31-32-36-31, "1261"
A 18:11:09.952 "1261" received
I 18:11:10.152 Read Response received from 00002a26-0000-1000-8000-00805f9b34fb, value: (0x) 56-32-2E-31-2E-31, "V2.1.1"
V 18:11:10.152 6 characteristics read
A 18:11:10.152 "V2.1.1" received
D 18:12:49.829 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
E 18:12:49.844 Error 8 (0x8): GATT CONN TIMEOUT
I 18:12:49.844 Disconnected
D 19:18:57.257 gatt.close()
D 19:18:57.279 wait(200)
V 19:18:57.483 Connecting to C0:26:DF:00:BC:F7...
D 19:18:57.485 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) (hidden)
D 19:19:02.312 [Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
E 19:19:02.312 Error 133 (0x85): GATT ERROR
I 19:19:02.312 Disconnected
D 19:19:55.447 gatt.close()
D 19:19:55.490 wait(200)
V 19:19:55.697 Connecting to C0:26:DF:00:BC:F7...
D 19:19:55.702 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) (hidden)
D 19:20:00.485 [Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
E 19:20:00.485 Error 133 (0x85): GATT ERROR
I 19:20:00.485 Disconnected
D 19:20:10.368 gatt.close()
D 19:20:10.376 wait(200)
V 19:20:10.594 Connecting to C0:26:DF:00:BC:F7...
D 19:20:10.594 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) (hidden)
D 19:20:10.852 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 19:20:10.852 Connected to C0:26:DF:00:BC:F7
D 19:20:10.854 wait(1600ms)
D 19:20:10.872 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
V 19:20:12.469 Discovering services...
D 19:20:12.469 gatt.discoverServices()
D 19:20:12.496 [Callback] Services discovered with status: 0
I 19:20:12.496 Services discovered
V 19:20:12.520 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Health Thermometer (0x1809)
- Temperature Measurement [I] (0x2A1C)
   Client Characteristic Configuration (0x2902)
Battery Service (0x180F)
- Battery Level [N R] (0x2A19)
   Client Characteristic Configuration (0x2902)
Device Information (0x180A)
- Model Number String [R] (0x2A24)
- Firmware Revision String [R] (0x2A26)
Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
- Button [I N W] (00001524-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
D 19:20:12.520 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 19:20:12.523 gatt.setCharacteristicNotification(00002a1c-0000-1000-8000-00805f9b34fb, true)
D 19:20:12.525 gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
D 19:20:12.527 gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
D 19:20:16.173 wait(400)
V 19:20:16.573 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 19:20:16.574 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
V 19:20:16.776 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 19:20:16.777 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
I 19:20:16.777 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
A 19:20:16.777 "TAIDOC TD1261" received
I 19:20:16.976 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
A 19:20:16.976 "TAIDOC TD1261" received
D 19:20:16.976 wait(3000)
V 19:20:19.977 Reading remote RSSI...
D 19:20:19.977 gatt.readRemoteRssi()
I 19:20:20.019 Remote RSSI received: -55 dBm
D 19:20:52.261 wait(400)
D 19:20:52.664 wait(1200)
D 19:20:53.866 wait(1500)
D 19:20:55.367 wait(1300)
D 19:20:56.669 wait(1800)
D 19:20:58.470 wait(400)
D 19:20:58.871 wait(800)
D 19:20:59.671 wait(900)
D 19:21:25.455 wait(400)
V 19:21:25.856 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 19:21:25.856 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
I 19:21:25.977 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
A 19:21:25.977 "TAIDOC TD1261" received
V 19:21:25.979 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 19:21:25.979 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
I 19:21:26.178 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
A 19:21:26.178 "TAIDOC TD1261" received
D 19:21:26.178 wait(3000)
V 19:21:29.178 Reading remote RSSI...
D 19:21:29.179 gatt.readRemoteRssi()
I 19:21:29.193 Remote RSSI received: -68 dBm
V 19:22:18.300 Reading descriptor 00002902-0000-1000-8000-00805f9b34fb
D 19:22:18.300 gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb)
I 19:22:18.501 Read Response received from descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 00-00
A 19:22:18.501 "Notifications and indications disabled" received
V 19:22:22.092 Reading descriptor 00002902-0000-1000-8000-00805f9b34fb
D 19:22:22.092 gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb)
I 19:22:22.275 Read Response received from descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 00-00
A 19:22:22.276 "Notifications and indications disabled" received
V 19:22:30.097 Reading descriptor 00002902-0000-1000-8000-00805f9b34fb
D 19:22:30.098 gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb)
I 19:22:30.275 Read Response received from descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 00-00
A 19:22:30.275 "Notifications and indications disabled" received
V 19:22:42.261 Reading characteristic 00002a01-0000-1000-8000-00805f9b34fb
D 19:22:42.261 gatt.readCharacteristic(00002a01-0000-1000-8000-00805f9b34fb)
I 19:22:42.375 Read Response received from 00002a01-0000-1000-8000-00805f9b34fb, value: (0x) 00-03
A 19:22:42.375 "[768] Generic Thermometer (Generic category)" received
V 19:22:45.510 Reading characteristic 00002a04-0000-1000-8000-00805f9b34fb
D 19:22:45.510 gatt.readCharacteristic(00002a04-0000-1000-8000-00805f9b34fb)
I 19:22:45.676 Read Response received from 00002a04-0000-1000-8000-00805f9b34fb, value: (0x) 28-00-50-00-00-00-90-01
A 19:22:45.676 "Connection Interval: 50.00ms - 100.00ms,
Slave Latency: 0,
Supervision Timeout Multiplier: 400" received
V 19:22:55.581 Reading characteristic 00002a01-0000-1000-8000-00805f9b34fb
D 19:22:55.581 gatt.readCharacteristic(00002a01-0000-1000-8000-00805f9b34fb)
I 19:22:55.775 Read Response received from 00002a01-0000-1000-8000-00805f9b34fb, value: (0x) 00-03
A 19:22:55.775 "[768] Generic Thermometer (Generic category)" received
V 19:22:57.121 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 19:22:57.121 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
I 19:22:57.275 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
A 19:22:57.275 "TAIDOC TD1261" received
D 19:23:12.582 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 19:23:12.582 Error 8 (0x8): GATT CONN TIMEOUT
I 19:23:12.582 Disconnected
D 19:23:12.708 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 20:47:37.760 gatt.close()
D 20:47:37.791 wait(200)
V 20:47:38.008 Connecting to C0:26:DF:00:BC:F7...
D 20:47:38.011 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) (hidden)
D 20:47:38.787 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 20:47:38.787 Connected to C0:26:DF:00:BC:F7
D 20:47:38.801 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D 20:47:38.810 wait(1600ms)
V 20:47:40.425 Discovering services...
D 20:47:40.425 gatt.discoverServices()
D 20:47:40.433 [Callback] Services discovered with status: 0
I 20:47:40.433 Services discovered
V 20:47:40.470 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Health Thermometer (0x1809)
- Temperature Measurement [I] (0x2A1C)
   Client Characteristic Configuration (0x2902)
Battery Service (0x180F)
- Battery Level [N R] (0x2A19)
   Client Characteristic Configuration (0x2902)
Device Information (0x180A)
- Model Number String [R] (0x2A24)
- Firmware Revision String [R] (0x2A26)
Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
- Button [I N W] (00001524-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
D 20:47:40.470 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 20:47:40.472 gatt.setCharacteristicNotification(00002a1c-0000-1000-8000-00805f9b34fb, true)
D 20:47:40.476 gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
D 20:47:40.478 gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
D 20:48:29.277 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 20:48:29.294 Error 8 (0x8): GATT CONN TIMEOUT
I 20:48:29.294 Disconnected
D 20:48:29.470 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 20:49:13.357 gatt.close()
D 20:49:13.369 wait(200)
V 20:49:13.581 Connecting to C0:26:DF:00:BC:F7...
D 20:49:13.581 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) (hidden)
D 20:49:14.511 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 20:49:14.511 Connected to C0:26:DF:00:BC:F7
D 20:49:14.527 wait(1600ms)
D 20:49:14.537 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
V 20:49:16.133 Discovering services...
D 20:49:16.133 gatt.discoverServices()
D 20:49:16.146 [Callback] Services discovered with status: 0
I 20:49:16.146 Services discovered
V 20:49:16.190 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Health Thermometer (0x1809)
- Temperature Measurement [I] (0x2A1C)
   Client Characteristic Configuration (0x2902)
Battery Service (0x180F)
- Battery Level [N R] (0x2A19)
   Client Characteristic Configuration (0x2902)
Device Information (0x180A)
- Model Number String [R] (0x2A24)
- Firmware Revision String [R] (0x2A26)
Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
- Button [I N W] (00001524-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
D 20:49:16.190 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 20:49:16.193 gatt.setCharacteristicNotification(00002a1c-0000-1000-8000-00805f9b34fb, true)
D 20:49:16.196 gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
D 20:49:16.199 gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
V 20:49:37.580 Reading remote RSSI...
D 20:49:37.581 gatt.readRemoteRssi()
I 20:49:37.595 Remote RSSI received: -63 dBm
V 20:49:50.155 Requesting new MTU...
D 20:49:50.155 gatt.requestMtu(517)
W 20:49:50.365 Requested MTU not supported. MTU changed to: 23
V 20:50:07.665 Requesting new MTU...
D 20:50:07.665 gatt.requestMtu(517)
W 20:50:07.864 Requested MTU not supported. MTU changed to: 23
V 20:50:31.329 Reading remote RSSI...
D 20:50:31.329 gatt.readRemoteRssi()
I 20:50:31.346 Remote RSSI received: -66 dBm
V 20:51:26.865 Reading all characteristics...
V 20:51:26.865 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 20:51:26.865 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
I 20:51:27.066 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
A 20:51:27.066 "TAIDOC TD1261" received
D 20:51:27.066 gatt.readCharacteristic(00002a01-0000-1000-8000-00805f9b34fb)
I 20:51:27.263 Read Response received from 00002a01-0000-1000-8000-00805f9b34fb, value: (0x) 00-03
A 20:51:27.263 "[768] Generic Thermometer (Generic category)" received
V 20:51:27.264 Reading characteristic 00002a04-0000-1000-8000-00805f9b34fb
D 20:51:27.264 gatt.readCharacteristic(00002a04-0000-1000-8000-00805f9b34fb)
V 20:51:27.465 Reading characteristic 00002a19-0000-1000-8000-00805f9b34fb
D 20:51:27.465 gatt.readCharacteristic(00002a19-0000-1000-8000-00805f9b34fb)
I 20:51:27.465 Read Response received from 00002a04-0000-1000-8000-00805f9b34fb, value: (0x) 28-00-50-00-00-00-90-01
A 20:51:27.465 "Connection Interval: 50.00ms - 100.00ms,
Slave Latency: 0,
Supervision Timeout Multiplier: 400" received
I 20:51:27.764 Read Response received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 57, "W"
A 20:51:27.764 "87%" received
V 20:51:27.764 Reading characteristic 00002a24-0000-1000-8000-00805f9b34fb
D 20:51:27.764 gatt.readCharacteristic(00002a24-0000-1000-8000-00805f9b34fb)
I 20:51:27.964 Read Response received from 00002a24-0000-1000-8000-00805f9b34fb, value: (0x) 31-32-36-31, "1261"
A 20:51:27.964 "1261" received
V 20:51:27.965 Reading characteristic 00002a26-0000-1000-8000-00805f9b34fb
D 20:51:27.965 gatt.readCharacteristic(00002a26-0000-1000-8000-00805f9b34fb)
I 20:51:28.165 Read Response received from 00002a26-0000-1000-8000-00805f9b34fb, value: (0x) 56-32-2E-31-2E-31, "V2.1.1"
A 20:51:28.165 "V2.1.1" received
V 20:51:28.166 6 characteristics read
V 20:51:33.291 Enabling services...
V 20:51:33.291 Enabling indications for 00002a05-0000-1000-8000-00805f9b34fb
D 20:51:33.291 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0200)
I 20:51:33.463 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 02-00
A 20:51:33.463 "Indications enabled" sent
V 20:51:33.472 Indications enabled for 00002a05-0000-1000-8000-00805f9b34fb
V 20:51:33.473 Enabling indications for 00002a1c-0000-1000-8000-00805f9b34fb
D 20:51:33.473 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0200)
I 20:51:33.664 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 02-00
A 20:51:33.664 "Indications enabled" sent
V 20:51:33.677 Indications enabled for 00002a1c-0000-1000-8000-00805f9b34fb
V 20:51:33.678 Enabling notifications for 00002a19-0000-1000-8000-00805f9b34fb
D 20:51:33.678 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
I 20:51:33.968 Indication received from 00002a1c-0000-1000-8000-00805f9b34fb, value: (0x) 06-1A-0E-00-FE-E2-07-06-04-14-30-00-02
A 20:51:33.968 "36.10°C
Time: 4 Jun 2018, 20:48:00
Type: Body (general)" received
I 20:51:33.972 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A 20:51:33.972 "Notifications enabled" sent
V 20:51:33.997 Notifications enabled for 00002a19-0000-1000-8000-00805f9b34fb
V 20:51:33.998 Enabling notifications for 00001524-1212-efde-1523-785feabcd123
D 20:51:33.998 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
I 20:51:34.164 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A 20:51:34.164 "Notifications enabled" sent
V 20:51:34.179 Notifications enabled for 00001524-1212-efde-1523-785feabcd123
V 20:51:34.179 All services enabled
I 20:51:34.186 Indication received from 00001524-1212-efde-1523-785feabcd123, value: (0x) 01-00
A 20:51:34.186 "Invalid value: (0x) 01-00" received
I 20:51:34.364 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 56, "V"
A 20:51:34.364 "86%" received
V 20:51:36.551 Reading remote RSSI...
D 20:51:36.551 gatt.readRemoteRssi()
I 20:51:36.556 Remote RSSI received: -67 dBm
V 20:51:39.890 Reading all characteristics...
V 20:51:39.890 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 20:51:39.890 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
V 20:51:40.065 Reading characteristic 00002a01-0000-1000-8000-00805f9b34fb
I 20:51:40.065 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
D 20:51:40.065 gatt.readCharacteristic(00002a01-0000-1000-8000-00805f9b34fb)
A 20:51:40.065 "TAIDOC TD1261" received
I 20:51:40.264 Read Response received from 00002a01-0000-1000-8000-00805f9b34fb, value: (0x) 00-03
A 20:51:40.264 "[768] Generic Thermometer (Generic category)" received
V 20:51:40.264 Reading characteristic 00002a04-0000-1000-8000-00805f9b34fb
D 20:51:40.264 gatt.readCharacteristic(00002a04-0000-1000-8000-00805f9b34fb)
V 20:51:40.464 Reading characteristic 00002a19-0000-1000-8000-00805f9b34fb
D 20:51:40.464 gatt.readCharacteristic(00002a19-0000-1000-8000-00805f9b34fb)
I 20:51:40.464 Read Response received from 00002a04-0000-1000-8000-00805f9b34fb, value: (0x) 28-00-50-00-00-00-90-01
A 20:51:40.464 "Connection Interval: 50.00ms - 100.00ms,
Slave Latency: 0,
Supervision Timeout Multiplier: 400" received
I 20:51:40.664 Read Response received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 56, "V"
A 20:51:40.664 "86%" received
V 20:51:40.664 Reading characteristic 00002a24-0000-1000-8000-00805f9b34fb
D 20:51:40.664 gatt.readCharacteristic(00002a24-0000-1000-8000-00805f9b34fb)
V 20:51:40.865 Reading characteristic 00002a26-0000-1000-8000-00805f9b34fb
I 20:51:40.865 Read Response received from 00002a24-0000-1000-8000-00805f9b34fb, value: (0x) 31-32-36-31, "1261"
D 20:51:40.865 gatt.readCharacteristic(00002a26-0000-1000-8000-00805f9b34fb)
A 20:51:40.865 "1261" received
I 20:51:41.064 Read Response received from 00002a26-0000-1000-8000-00805f9b34fb, value: (0x) 56-32-2E-31-2E-31, "V2.1.1"
A 20:51:41.064 "V2.1.1" received
V 20:51:41.064 6 characteristics read
I 20:51:44.366 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 55, "U"
A 20:51:44.367 "85%" received
V 20:51:52.097 Requesting new MTU...
D 20:51:52.097 gatt.requestMtu(23)
I 20:51:52.263 MTU changed to: 23
I 20:51:54.368 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 54, "T"
A 20:51:54.368 "84%" received
I 20:52:04.368 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 53, "S"
A 20:52:04.368 "83%" received
I 20:52:14.385 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 52, "R"
A 20:52:14.385 "82%" received
I 20:52:24.376 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 51, "Q"
A 20:52:24.376 "81%" received
I 20:52:34.374 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 52, "R"
A 20:52:34.374 "82%" received
I 20:52:44.472 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 53, "S"
A 20:52:44.472 "83%" received
I 20:52:54.366 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 54, "T"
A 20:52:54.366 "84%" received
I 20:53:04.373 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 55, "U"
A 20:53:04.374 "85%" received
I 20:53:14.377 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 56, "V"
A 20:53:14.377 "86%" received
I 20:53:24.372 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 57, "W"
A 20:53:24.372 "87%" received
I 20:53:34.369 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 58, "X"
A 20:53:34.369 "88%" received
I 20:53:44.377 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 59, "Y"
A 20:53:44.377 "89%" received
I 20:53:54.371 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 5A, "Z"
A 20:53:54.371 "90%" received
I 20:54:04.374 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 5B, "["
A 20:54:04.374 "91%" received
V 20:54:12.692 Reading all characteristics...
V 20:54:12.692 Reading characteristic 00002a00-0000-1000-8000-00805f9b34fb
D 20:54:12.693 gatt.readCharacteristic(00002a00-0000-1000-8000-00805f9b34fb)
V 20:54:12.864 Reading characteristic 00002a01-0000-1000-8000-00805f9b34fb
D 20:54:12.864 gatt.readCharacteristic(00002a01-0000-1000-8000-00805f9b34fb)
I 20:54:12.865 Read Response received from 00002a00-0000-1000-8000-00805f9b34fb, value: (0x) 54-41-49-44-4F-43-20-54-44-31-32-36-31-00-00-00-00-00-00-00
A 20:54:12.865 "TAIDOC TD1261" received
I 20:54:13.063 Read Response received from 00002a01-0000-1000-8000-00805f9b34fb, value: (0x) 00-03
A 20:54:13.063 "[768] Generic Thermometer (Generic category)" received
V 20:54:13.063 Reading characteristic 00002a04-0000-1000-8000-00805f9b34fb
D 20:54:13.063 gatt.readCharacteristic(00002a04-0000-1000-8000-00805f9b34fb)
V 20:54:13.264 Reading characteristic 00002a19-0000-1000-8000-00805f9b34fb
D 20:54:13.264 gatt.readCharacteristic(00002a19-0000-1000-8000-00805f9b34fb)
I 20:54:13.264 Read Response received from 00002a04-0000-1000-8000-00805f9b34fb, value: (0x) 28-00-50-00-00-00-90-01
A 20:54:13.264 "Connection Interval: 50.00ms - 100.00ms,
Slave Latency: 0,
Supervision Timeout Multiplier: 400" received
I 20:54:13.464 Read Response received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 5B, "["
V 20:54:13.464 Reading characteristic 00002a24-0000-1000-8000-00805f9b34fb
A 20:54:13.464 "91%" received
D 20:54:13.464 gatt.readCharacteristic(00002a24-0000-1000-8000-00805f9b34fb)
V 20:54:13.664 Reading characteristic 00002a26-0000-1000-8000-00805f9b34fb
I 20:54:13.665 Read Response received from 00002a24-0000-1000-8000-00805f9b34fb, value: (0x) 31-32-36-31, "1261"
D 20:54:13.665 gatt.readCharacteristic(00002a26-0000-1000-8000-00805f9b34fb)
A 20:54:13.665 "1261" received
I 20:54:13.966 Read Response received from 00002a26-0000-1000-8000-00805f9b34fb, value: (0x) 56-32-2E-31-2E-31, "V2.1.1"
A 20:54:13.966 "V2.1.1" received
V 20:54:13.967 6 characteristics read
I 20:54:14.363 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 5C, "\"
A 20:54:14.363 "92%" received
I 20:54:24.367 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 5D, "]"
A 20:54:24.367 "93%" received
I 20:54:34.370 Notification received from 00002a19-0000-1000-8000-00805f9b34fb, value: (0x) 5E, "^"
A 20:54:34.370 "94%" received
D 20:54:38.479 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 20:54:38.479 Error 8 (0x8): GATT CONN TIMEOUT
I 20:54:38.479 Disconnected
D 20:54:38.638 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED

Carlos E. Bieberach
Sent from my Android Note 3

Chris Ward

unread,
Oct 23, 2018, 11:01:05 PM10/23/18
to MIT App Inventor Forum
Carlos - is this the device? (See Attached PDF)

I see the manufacturer has an Android app for the device, "Healthy Check"

TD-1261CD_DM.pdf

Chris Ward

unread,
Oct 23, 2018, 11:47:09 PM10/23/18
to MIT App Inventor Forum

Carlos Bieberach

unread,
Oct 24, 2018, 12:04:59 AM10/24/18
to MIT App Inventor Forum
Yes, that is the manufacturer. Not the app I used to generate the log data i posted I few minutes ago.

Carlos Bieberach

unread,
Oct 24, 2018, 12:09:39 AM10/24/18
to MIT App Inventor Forum
That is the exact thermometer I'm using

Chris Ward

unread,
Oct 24, 2018, 8:30:11 AM10/24/18
to mitappinv...@googlegroups.com
Hi Carlos

OK, I think we can put some code together to:
  • Find the thermometer
  • Collect Data it is sending out

Potential Problems:
  • May need to "handshake" (a form of password) - do not know and the manufacturer has no information on their website
  • We do not know the data type
  • Data could be encrypted
  • Device is using Bluetooth Smart, the predecessor to BLE, famous for it's unreliability
I'm away from the office now until about 16:00 UK time. 

Carlos Bieberach

unread,
Oct 24, 2018, 8:55:06 AM10/24/18
to MIT App Inventor Forum
That's great news !!

Thank you for your help

Carlos

gerrikoio

unread,
Oct 24, 2018, 11:27:14 AM10/24/18
to MIT App Inventor Forum
Had a quick look at the data from your nRF Connect log.

I see it lists the Health Thermometer (0x1809) GATT Service.

To find out about this standard GATT Service you start here: 


This lists out all the services and will provide information on the data structure etc. as shown here:


If you look at the definition it will give you the different characteristics. 

So, if you use the nRF Connect App and click on the Health Thermometer service this will provide you with the list of characteristics. One of these characteristics will be Temperature Measurement. 

Then with App Inventor you need to link the GATT service and the characteristic and you will be able to get the data you need.

If you need any more help please let me know.

Chris Ward

unread,
Oct 24, 2018, 2:59:03 PM10/24/18
to MIT App Inventor Forum
Hi Carlos

It's good to have gerrikoio on board - I think he knows far more about Bluetooth than I do :)

Let's start by trying to find the thermometer. It's a Bluetooth v4.0 "Bluetooth Smart" Device. The latest MIT App Inventor BLE extension can be downloaded from here:


If you have not installed an extension for an App Inventor Project before, there is a slide-show how-to on my website:


Once you have got that far, here is some code to find BLE devices:

BLE_ScanForDevices.png


Your Phone or other Android computer that will run your App must of course support BLE, which is Bluetooth version 4.0 and up. 



Carlos Bieberach

unread,
Oct 24, 2018, 3:27:58 PM10/24/18
to MIT App Inventor Forum
Thank you very much for the links !! Very interesting information indeed.

Will install the latest extensions and test.

Tyan you again !!

Carlos

Carlos Bieberach

unread,
Oct 24, 2018, 3:31:01 PM10/24/18
to MIT App Inventor Forum
Thank you Chris !!

Will test with new extensions in the next 20 minutes.

Will post my findings and screen shots soon.

Thanks,

Carlos

Carlos Bieberach

unread,
Oct 24, 2018, 4:32:50 PM10/24/18
to MIT App Inventor Forum
Chris,
How do i download the .png ?

Carlos

Carlos Bieberach

unread,
Oct 24, 2018, 4:38:12 PM10/24/18
to MIT App Inventor Forum
Thank you gerrikoio.

I think i thank you before on another thread. Very useful information !!

Carlos

Chris Ward

unread,
Oct 24, 2018, 4:43:28 PM10/24/18
to MIT App Inventor Forum
Hi Carlos

Do you mean the image of the Blocks that I posted? You can right-click save image as.


Chris Ward

unread,
Oct 24, 2018, 5:24:46 PM10/24/18
to MIT App Inventor Forum
.... or to post images on the forum, see this guide: 


Carlos Bieberach

unread,
Oct 24, 2018, 11:26:18 PM10/24/18
to MIT App Inventor Forum
Thank you Chris for the blocks. And thank you gerrikoio for the links.

As you guys can see on the attached snapshot, the App is able to discover the devices around me including the Taidoc thermometer. So that's good.

Any examples on how to try to capture the data ?

Thank you in advance,

Carlos
Screenshot_2018-10-24-22-59-35.png

gerrikoio

unread,
Oct 25, 2018, 6:01:20 AM10/25/18
to MIT App Inventor Forum
I had posted a BLE heart rate monitor example, some time back. It should help you.


As noted in that post, I could not attach the aia file, so I uploaded into Github for public access.



To quickly walk through the process - apologies for any grammar errors as posting draft. 

The first step is to initiate a connection request which then triggers the BLE connected event.

MIT_App_BLEconnect.PNG


Within the BLE Connected block there are a couple of things that need doing:


1. We need to get the list of supported GATT services found with the connected devices. We use "Get SupportServices" method.


This is a list, so we need to search through it. I created a custom procedure to do this called "parseServiceUUID". This can be found in the example link.


You will need to modify the parseServiceUUID procedure, if planning to use it, to search for the Health Thermometer GATT Service - that is search to find (0x1809).


The procedure returns the index of where this is found in the list.


2. Using this index we now need to get the Characteristics associated with that service. There is a method for that "call BLE GetCharacteristicsForService".


This is another list. As this return list is standard for the 0x1809 service, I simply take a short cut here and manually use the index for the characteristic I need to use - you can use the nRFconnect app to manually determine the index number for the Temperature Measurement Characteristic.


3. You now need to "register" for Bytes to receive data when it is available. This is for the notify option. As the temperature measure uses the "indicate" option this should work.


You use the "call RegisterForBytes method" using the parameters you've just obtained for GATT Service and for Characteristic.


You would need to register for each characteristic that has the notify or indicate property and use the read bytes method for characteristics that have read property.


MIT_App_BLEconnect_123.PNG



A "when Bytes received" event will then be triggered when new information is received in the stack buffer.


You need the parse through the data and extract the relevant bytes. Use the GATT service link I sent previously as your guide.


A sample of this is shown here (based on the heart rate monitor example).



MIT_App_BLEreadBytes.PNG


Hope that helps.

Chris Ward

unread,
Oct 25, 2018, 6:03:23 AM10/25/18
to MIT App Inventor Forum
Hi Carlos

I don't really know what data the device sends out, or whether we can ask the device for specific information. I had expected it to give minimal data such as type + value e.g. Celsius + 10.

Also not sure of the format of the data - again because the manufacturer does not provide this information.

I'm hoping we can make some headway quickly with a bit of trial and error.

So, the next stage of the code will take the device ID as picked in the List View, and try to connect to it. If that is a success, try to get what ever data is available.


Chris Ward

unread,
Oct 25, 2018, 6:07:30 AM10/25/18
to MIT App Inventor Forum
...ah, gerrikoio is well ahead of me there!

By the way, now that you know the device ID, you don't have to scan for all devices and list them, just check that it is in the list and then connect to it if so.

gerrikoio

unread,
Oct 25, 2018, 6:08:32 AM10/25/18
to MIT App Inventor Forum

Chris Ward

unread,
Oct 25, 2018, 6:43:20 AM10/25/18
to MIT App Inventor Forum
Hi gerrikoio

Yes, I read that, but it does not relate exactly to the data extracted by the "other app" that Carlos got output from, which does have identifiers as per the GATT table, but excludes the actual temperature value. I think both the Bluetooth site and the manufacturer's site could be a bit more developer friendly.........

gerrikoio

unread,
Oct 25, 2018, 7:55:59 AM10/25/18
to mitappinv...@googlegroups.com
Hi Chris

I don't quite follow your logic. Carlos extract shows the following:

- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Health Thermometer (0x1809)
- Temperature Measurement [I] (0x2A1C)
   Client Characteristic Configuration (0x2902)
Battery Service (0x180F)
- Battery Level [N R] (0x2A19)
   Client Characteristic Configuration (0x2902)
Device Information (0x180A)
- Model Number String [R] (0x2A24)
- Firmware Revision String [R] (0x2A26)
Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
- Button [I N W] (00001524-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)

There is also a custom service "Nordic LED Button Service" which has a characteristic "Button" that shows it has the Indicate, Notify and Write properties.

Are you saying that the data resides within this service and not the standard Health Thermometer service?


Abraham Getzler

unread,
Oct 25, 2018, 11:11:03 AM10/25/18
to MIT App Inventor Forum

Chris Ward

unread,
Oct 25, 2018, 12:05:25 PM10/25/18
to MIT App Inventor Forum
Hello gerrikoio

As I understood the Bluetooth table, those two values identify the device type and sub type (capability). There should be values identifying units and actual temperature, which I didn't see in that data - of course, that does not mean it is not in there somewhere. 

What I am saying is that the Bluetooth website is (very) poorly defined and the manufacturer should publish more than near zero information - some examples would not go amiss on either site.

gerrikoio

unread,
Oct 25, 2018, 12:21:38 PM10/25/18
to MIT App Inventor Forum
The (0x1809) GATT spec for a Health Thermometer states the following for Service Characteristics:

1. Temperature Measurement - MANDATORY
2. Temperature Type - OPTIONAL
3. Intermediate Temperature - OPTIONAL
4. Measurement Interval - OPTIONAL

So from I can make out, the TAIDOC TD1261 device is fully compliant with the spec.

gerrikoio

unread,
Oct 25, 2018, 12:38:32 PM10/25/18
to mitappinv...@googlegroups.com
Then looking at the Temperature measurement data structure you should see the following:

1. Flags: data type "byte" 
is configured as: 

bit 0: Temperature units. If set as 0 then units = Celcius, else is Fahrenheit
bit 1: Timestamp flag. If set as 0 then time stamp not present
bit 2:  Temperature Type flag. If 0 then not present
bits 3 to 7 are reserved for future use

2. Temperature Value - Celcius: data type "Float"
This is only set if bit 0 set as 0

3. Temperature Value - Fahrenheit: data type "Float"
This is only set if bit 0 set as 1

This is only set if bit 1 is value 1

This is only set if bit 2 is value 1

 
So, basically read the first byte and depending on the value given, this will determine what data you have received.


 

Carlos Bieberach

unread,
Oct 26, 2018, 12:03:21 AM10/26/18
to MIT App Inventor Forum
I was not able to test today. Will resume first thing in the morning.

Thank you all for the great support.

Will post my test results in the morning.

Carlos

Chris Ward

unread,
Oct 26, 2018, 5:09:56 AM10/26/18