From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Data From Wearable BLE Device

Solved!
Go to solution

Hoping someone could help here with reading data from wearable device which uses BLE.

-Device-Hexiwear: https://learn.mikroe.com/hexiwear/

-Operating System: Windows 10

-Installed LabVIEW Bluetooth Low Energy (BLE) Instrument Drivers for Windows (https://forums.ni.com/t5/NI-Labs-Toolkits/LabVIEW-Bluetooth-Low-Energy-BLE-Instrument-Drivers-for-Wi... )

-Pairing is done and NI BLE Server is up and running.

-Discover BLE.vi shows the device and it's address.

-Used Initialize BLE.vi with Base URL as http://localhost:5000 and my device address Node ID(No error)

 

Now the problem is to read data:

-Tried Read BLE Channel.vi with for e.g., 2a00 which should give the device name but returns nothing.

-Tried getting the url which and typed in browser: http://localhost:5000/gatt/nodes/00:23:40:08:00:3b/characteristics/2a00/value and received 

{"self":"http://localhost:5000/gatt/nodes/00:23:40:08:00:3b/characteristics/2a00","handle":"2a00","value":null}

-Tried with Windows App:Newbit BLE Tool and it shows all the services running and data.

-Android App like BLE Scanner and nRF Connect also works.

 

-What have i done wrong?

-Is there a way to discover/enumerate all the services running along Characteristics with UUID?

 

Cross Posted: http://forums.ni.com/t5/NI-Labs-Discussions/LabVIEW-Bluetooth-Low-Energy-Support-Discussion/m-p/3623...

Thanks
uday
Message 1 of 9
(7,805 Views)
Solution
Accepted by topic author udka

Finally was able to get the data by the following method:

-Disable Firewall and/or Antivirus.

-Enable the NI BLE Server

Getting Device Address:

-Query or enter the follwing in Browser: http://localhost:5000/gatt/nodes/?connect=1 and get the device address(which will be used further).

-Internally all queries are through HTTP Get.vi hence whatever urls working in browser will work.

Getting all Services:

-Then query http://localhost:5000/gatt/nodes/00:23:40:08:00:3b/services/ to get all the services running in that device(address: 00:23:40:08:00:3b)

-After above query, we should be able to see all the uuid and services along with their handles.

Getting all Characteristics under particular service:

-The above url followed by the handle/characteristics will return the characteristics running under that service.

-For E.g. the Service handle is A then the query should be : http://localhost:5000/gatt/nodes/00:23:40:08:00:3b/services/A/characteristics/

-Note down the Characteristics handle for which need to read the data and corresponding UUID.

Reading the Data from the Characteristic:

-From the Bluetooth spec or from the manual get the uuid which need to be read.

-Corresponding handle should be given to Read Channel Read BLE Channel.vi along with the type of data it returns.

-Which should be something like(Where B is the handle ) http://localhost:5000/gatt/nodes/00:23:40:08:00:3b/characteristics/B/value/

Thanks
uday
Message 2 of 9
(7,727 Views)

Hi! I'm trying to get Heart Rate data from a polar H7 with Labview.

I've done what you were saying, i get the device service list, and inside the Heart Rate service (UUID: 180D) there is the Heart Rate Measurement characteristic (UUID: 2A37).

but im stuck here. I don't know how to read the data. If i call the HRMeasurement handler / VALUE i get NULL.

 

can you or anybody help me??

 

Thanks!!!

0 Kudos
Message 3 of 9
(7,650 Views)

-Did you disable Firewall?

-When you type the url in browser does it show services and handles?(provide Screenshot)

-Provide the screenshot of characteristics under that service handle.

-You will have different handles for services and characteristics. You need to use characteristics handle to get the value not the service handle.

 

Thanks
uday
0 Kudos
Message 4 of 9
(7,647 Views)

Here are the screenshots. I get the characteristic of Heart Rate Measurement, but the value I read is NULL.

 

thanks for the quick answer!!

Download All
0 Kudos
Message 5 of 9
(7,644 Views)

Under service handle 11 there are two characteristics 12 and 15.

-As i mentioned earlier you need to use characterisctics handle 12(Corresponding to UUID 2A37) not 11(this is service handle).

Thanks
uday
0 Kudos
Message 6 of 9
(7,634 Views)

Sorry, bad screenshot. This is the good one. I'm already doing it with the correct characteristic handler.

I've seen in the HRMeasurement service (https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.heart_ra...) that the measurement characteristic has a descriptor as client characteristic configuration (UUID: 2902) that i have to write to start sending the HR, but in the browser it doesn't show, so i don't know the handler to write.

 

any ideas?

 

thank you!!

 

 

0 Kudos
Message 7 of 9
(7,625 Views)

Other Characteristics are giving values or they are also returning null?

Thanks
uday
0 Kudos
Message 8 of 9
(7,616 Views)

characteristic 15 (Body Sensor Location) is returning 1 that is chest position, so this is okey 😞

 

 

0 Kudos
Message 9 of 9
(7,612 Views)