Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW BLE (Bluetooth Low Energy) toolkit

BLE Toolkit

 

BLE (Bluetooth LE, Bluetooth low energy, marketed as Bluetooth Smart) is a wireless personal area network technology designed and marketed by the Bluetooth Special Interest Group aimed at novel applications in the healthcare, fitness, beacons, security, and home entertainment industries. Compared to Classic Bluetooth, Bluetooth Smart is intended to provide considerably reduced power consumption and cost while maintaining a similar communication range. Wikipedia entry.

 

While LabVIEW supports Classic Bluetooth (on Windows), it does not provide support for BLE. To solve this issue, a workaround is to use a BLE dongle to handle the communication. http://digital.ni.com/public.nsf/allkb/4BA51235CFC8519086257F5E005E81D5

 

The BLE toolkit for LabVIEW is an implementation of the API Bluegica BGAPI v1.10 , that allows to communicate with Bluegiga BLE(D)11x and WF121 devices using USB/UART.

 

During the development of the Toolkit, the BLED112 USB dongle was used

 

Beside the Toolkit, three examples are provided:

* Discover and connect to BLE devices (ble_scan_devices.vi)

* Reading and Writing Characteristics values (ble_read_write_characteristics.vi)

* Acquiring Heart Rate data stream (ble_read_hr_monitor.vi)

 

Instructions.

 

1. Get a BLED112 USB dongle (e.g. in Digi-Key)

2. Install the drivers provided by Bluegiga
3. Verify the COM number for the dongle in Device Manager > Ports

4. Download and install the LabVIEW BLE Toolkit (package below)

5. Open the ble_scan_devices.vi example provided in
<Labview>\examples\BLE\Examples\ble_scan_devices.vi

6. Select the COM port for your BLED112 dongle

7. Run the VI

 

Screenshot 2016-07-28 19.59.23(2).png

 

The source files for this Toolkit are available on GitHub: https://github.com/MuSAELab/BLE-Toolkit-LabVIEW

 

INSTALLATION

 

To install the BLE Toolkit for LabVIEW, the VI Package Manager by JKI is needed.

  1. Download and install VI Package Manager
  2. Download and install the last VI package for the BLE Toolkit for LabVIEW from here

 

Raymundo Cassani
Comments
sort897
Member
Member
on

Hi, rCassani

I am very happy to see this post, 

I already try this toolkit; it works well.

Thanks for your sharing.

satode
Member
Member
on

Hi, rCassani.

Im trying to communicate with an arduino using a Bluetooth BLE 4 HM11 module. It already works with an android application using the service FFE0 and characteristic FFE1, but it doesn´t work with the labview toolkit. I´m using the dongle BLED112 of Bluegiga. The scan VI shows me the devices, but when I try to connect with the Mac address it shows an error.

 

Error 0 occurred at Service: 1800 and Characteristic 2A00 were not found

Possible reason(s):

LabVIEW:  Error connecting to GPIB driver or device. The NI-488.2 driver may not be installed.

=========================

NI-488:  Error connecting to driver or device. The NI-488.2 driver may not be installed.

=========================

VISA:  (Hex 0x0) Operation completed successfully.

 

I already installed the Driver but it keeps showing me the same mistake. I also tried with the other service and characteristic, but it keeps throwing the same mistake, any hints or suggestions are more than welcome.

 

Thank you in advance and Best Regards

satode
Member
Member
on

The toolkit is working perfect.

Thanks!

Dzamudio
Member
Member
on

Toolkit working perfect!

Does someone knows how to subscribe for notifications for a certain characteristic? Can't figure it out how to do it.

 

Thanks 🙂

mauromendes
Member
Member
on

Hi! Can anyone tell me if this solution works with others Bluetooth 4.0 USB Dongles(the generic ones) or just with the BLED112? Thanks!

LeoVGL93
Member
Member
on

Hi rCassani, I'm going to use the Dongle to communicate with a BLE device, but at the moment I have a question, send commands and write characteristics is the same?.

I want to send commands, get a response, and update some registers values from the device.

 

JacobKris
Member
Member
on

Hi, I have the same question as Dzamudio, can anyone tell me how to enable "live notifications"? Is there a BLE block in the BlueGiga toolkit?

Vecturianer
Member
Member
on

Hi,

 

Great toolkit. Exactly what I am looking for. Unfortunately I do not have Labview 2013.

Could you make the toolkit accessible for users with Labview 2010?

 

Thank you!

leoSau
Member
Member
on

I'm using a TI sensortag cc2650, does anyone know how to enable notifications?

Toolkit works great, here is my VI.

 

Thanks.

 

leoSau
Member
Member
on

I enabled notifications for the TI sensortag cc2650, sequence:

 

1. Write 0x01 to sensor configuration UUID to enable data collection [temperature sensor AA02, humidity sensor AA22, ...].

2. Write 0x0100 to sensor notification UUID 2902.

3. Monitor the attribute value event [use ble_evt_attclient_attribute_value.vi in the above toolkit]

 

 

kwe3hk
Member
Member
on

 Hi leoSau,

 

Can you send your vi example?

kwe3hk
Member
Member
on

Hi leoSau,

The link of your vi does not work. Can you send again? Thanks.

leoSau
Member
Member
on

kwe3hk,

I submitted the vi for review on 5/19, it must still be in NI's review process, maybe someone at NI can answer.

When I login the link works for me, and besides the submit for review button there is a publish button which I've tried twice, the submission process is a bit confusing.

NI_huangpu
Member
Member
on

 Error 0 occurred at Service: 1800 and Characteristic 2A00 were not found

Possible reason(s):

LabVIEW:  Error connecting to GPIB driver or device. The NI-488.2 driver may not be installed.

=========================

NI-488:  Error connecting to driver or device. The NI-488.2 driver may not be installed.

=========================

VISA:  (Hex 0x0) Operation completed successfully.

 

I already installed the Driver but it keeps showing me the same mistake. I also tried with the other service and characteristic, but it keeps throwing the same mistake, any hints or suggestions are more than welcome.

 

Thank you in advance and Best Regards

ck1984
Member
Member
on

hello cassani,

i have tried your toolkit with success. thank you. hopefully you can help me with my important question.

I´m using the heart rate example from you and it updates the rate from 0 - 255. i need to send bigger data from my arduino 101 and very fast. How can i increase the data size from  U8 to bigger one?

 

your help would be very nice.

thank you

labview_user123
Member
Member
on

I have the same problem as  mauromendes.. Can anyone tell me if this works with other / generic BLE dongles?

 

Anyone have any VI examples of this?

Dzamudio
Member
Member
on

labview_user123No, This VI only works with the BLED12 USB, as this VI communicate as a COM Port with the device. 

MaximeR
Active Participant
Active Participant
on

Hi rCASSAni,

 

You did a very good job. I just have a question about the toolkit. I spent some time on it and don't find the answer. Is it possible to catch Bluetooth Low Energy Notification ?

For my project, I can do a read on this attributes, but if i can have something based on Bluetooth event like notification it can be better. I Can do it with the Bluegiga GUI application.

 

Thanks for your help and for the toolkit.

 

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

acovian
Member
Member
on

Hey this works great for me! I have one minor problem. I am using the a slightly modified version of the ble_scan_devices.vi and I am seeing a problem where the device name returned from this VI is missing the last 3 characters. My device name is pretty long. It is expected to be 25 characters but it is only returning 22 characters. Has anyone seen this and know how to make the VI return the full device name?

Mauro1979
Member
Member
on

Hi, 

does the toolkit work with Testo 115i equipped with LSD Science & Technology Co., Ltd L Series BLE Module (08 Mai 2013) based on TI CC254X chip?

I'm using Win10 with Labview 2016.

Thank you very much.

acaracciolo
Member
Member
on

Sorry, will move this to support.

---------

 Hello all,

Does anyone have a VI that connects and pairs with the device using a passkey? Using a MAC (MM:MM:MM:SS:SS:SS) and six-digit pin (DDDDDD).

Thanks.

SieSas
Member
Member
on

Hi,

I tried to use the toolkit with the BLED112-V1 and LabVIEW 2013 SP1 (32Bit). When I start the ble_scan_devices.vi the dongle cannot even be found. The Windows Device Manager tells me, the dongle is working properly. But in LabVIEW there's an error in the first SubVI reset_dongle_and_cnx.vi. Is someone familiar with this problem and can help to fix it?

 

Thanks in advance

David_Hendrix
Member
Member
on
I am having the same issue that the dongle cannot be found despite windows device manager showing proper operation. SubVI reset_dongle_and_cnx.vi returns error -1073807360. Was there ever an answer found for this issue?
MaximeR
Active Participant
Active Participant
on

Hello,

 

You must install the Bluegiga Drievr for Windows. If you keep the device with the Windows Driver, you cannot use the dongle with the toolkit.

 

Best regards.

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

LePF
Member
Member
on

@satode, how did you resolve your problem?

I have got the same problem as you..

("Error 0 occurred at Service: 1800 and Characteristic 2A00 were not found")

MaximeR
Active Participant
Active Participant
on

Hi,

 

Have you tried with Bluegiga GUI. If you go on silabs website and dowload the blugiga SDK, you have an appliation blegui2.exe in c:\Bluegiga\ble-X.X.X.X\bin.

Try with this software to make sure your dongle is working properly.

 

This app also help me a lot to build my LabVIEW application.

 

Regards

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

LePF
Member
Member
on

Thanks MaximeR for your answer.

Indeed, it didn't work with blegui2.exe too.

In fact it was due to my BLE Device, I just tried with another peripheral and now it is works fine!

 

SetecTestDept
Member
Member
on

Correct me if I'm wrong, but this toolkit only allows you read data from another BLE device as a client.

It does not allow you (at least the available VI's in the package) to act as a server i.e. provide a BLE service so that other devices can connect.

It allows you to scan, but not advertise.

There are limitations to this package.

MaximeR
Active Participant
Active Participant
on

Hello,

 

That's correct.It seems that the Blugiga API allow to use this dongle to build a device with this dongle, but it's not implemented inside this toolkit.

 

Best Regards

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

TomCamp
Member
Member
on

Thanks for the great kit. But in my device, the program doesn't work well even when I installed the driver provided by Bluegiga. The Bluegiga BLE GUI can find the port and send message, I don't know what the mistake is. Thank you so much!捕获2.PNG捕获3.PNG
捕获.PNG

MaximeR
Active Participant
Active Participant
on

Hi,

 

It's seems that you did the right things. In the Blugiga GUI, set the baudrate to 115200. It works better for me at this baudrate. Click on attach, and click on start for seraching device. If you have a smartphone that is compatible with Bluetooth low energy, turn it on, you will normally see your phone in the GUI.

 

If not, try to uninstall the device driver from Peripherical Manamger and reinstall it.

You must be able to read dongle info with LabVIEW if your dongle is working well.

 

Maybe this is your dongle that is not working.

Best Regards.

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

L@B
Member
Member
on

Hi All,

 

I am using BLE 112 (master) and HM-10 (Slave). With the BLE labview toolkit, i am able to connect to my slave. I am trying to send the data from my slave to the BLE 112.But BLE read by service and character is always return me the slave address (default data).  I had verified the data is received by BLE 112 with the BLE GUI(from Silicon Lab) but when perform an other read then return slave address (default data).  

 

Correct UUID was used.

Is there way to make the data persistence until BLE read is perform?

 

Any suggestion is welcome. Thanks in advance.

MaximeR
Active Participant
Active Participant
on

Hi, 

 

This is not clear for me. Is it working with the Blugiga GUI ? if yes, can you tell us wich function you try to use to recieved on your master from the toolkit ?

I never try to wait for on master side to the slave to send data, but if I can help, I will try.
you can find also some information about the blugiga API. If I remember right, the VI name are based on the API function of the API. it can help you.

 

Best regards.

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

isco1024
Member
Member
on

Hi, 

I work on a project and I use the BLE toolkit and BLED112 dongle to receive data sent by my Redbear Ble Nano v2. I achieved an application on LabView by modifying the ble_read_hr example. I modified the BLE toolkit and I use a minimal and maximal interval connection of 7.5ms on the ble_connect_to_device.vi. I can read 45 packs of 20 bytes per second (45*20*8 = 7200 bits/s) without data loss. My goal is to obtain 100 packs of 20 bytes per second (100*20*8 = 16 000 bits/s). However, I can't recover all data in this configuration, I lose packs.

I would be very grateful if a person can tell me if it's possible to improve the data recuperation and explain me how to achieve this in this case.

Thank you in advance.

 

lightstring
Member
Member
on

Hi,

 

I followed all the instructions.  I can see my BLED112 in Computer Management > Ports > as Bluegiga Bluetooth Low Energy (COM7), but when I run this VI and change it to COM7 nothing happens.  It doesn't populate the BLED112 Dongle Info.  Is there something I am missing?  I installed the manufactures SDK and I could connect to the dongle and scan just fine.  Is it possible it is using the windows drivers and not the Bluegiga drivers?  The direct diver link didn't work in the instructions above.  Windows 10, Labview 2018 SP1 btw.

 

Thanks,

MaximeR
Active Participant
Active Participant
on

Hi lightstring,

 

Try to donwload this with this link : https://www.silabs.com/documents/login/software/BLED112-Signed-Win-Drv.zip
The date of the driver is 11/15/2009.

Try also to change the Datarate of the COM port to 115200 in device Manager in Windows.

Best regards.

 

 

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

lightstring
Member
Member
on

Hi MaximeR,

 

I found those drivers after I made the post and verified the device was using the drives in Device Manager by looking at driver date and Driver provider was Bluegiga.  So I know it's using the correct driver.

1com7.PNG

2com7.PNG

I changed the baud and still get nothing.  The green light next to "Scan" lights up for a brief moment each time I start the VI but nothing happens after the fact.

 

Looking at the debug of the VI I get this following error.

 

 

Error -1073807202 occurred at VISA Close in ble_reset_dongle_and_cnx.vi->ble_scan_devices.vi

Possible reason(s):

LabVIEW: (Hex 0xBFFF009E) VISA or a code library required by VISA could not be located or loaded.  This is usually due to a required driver not being installed on the system.

Still seems like a driver issue.

 

Thanks,

 

 

MaximeR
Active Participant
Active Participant
on

Hi,

 

Try the example Ble scan devices without executinng the reset fucntion (first function of the code). after a restart of the computer to stack all the odds in your favour.


I already get some troubles with this function.
Let see if you list devices.

Best regards.

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

lightstring
Member
Member
on

I deleted the first vi, saved it, and restarted.

Sadly, same outcome.  Really don't get what is wrong here.  I will try to uninstall the device from device manager and start over.  Any other ideas?  Thanks,

 

1.PNG

Error -1073807202 occurred at Property Node (arg 1) in VISA Configure Serial Port (Instr).vi->ble_attach_dongle.vi->ble_scan_devices.vi

Possible reason(s):

LabVIEW: (Hex 0xBFFF009E) VISA or a code library required by VISA could not be located or loaded.  This is usually due to a required driver not being installed on the system. 

 

MaximeR
Active Participant
Active Participant
on

Hi,

 

This is a little bit strange. Can you give us a link of the BLE dongle you bought ?
Can you give more details on your hardware configuration ?

Does the dongle is directly conected to the PC ?

If you are using desktop, can you plug the dongle on a rear USB (avoid front connector) and a USB 2 port.

If you are using a USB hub, please try without it.

If you are using a laptop, try all the USB port.

 

Last thing, try to open a session from MAX with the test panel. If this doesn't work, there is a problem on accessing the device independently from the toolkit.

 

Best regards.

 

 

Hope this helps.

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

lightstring
Member
Member
on

I bought the BLE112 dongle linked in the toolkit on digikey.  I have a HP Desktop z440.  I have tried both a USB hub and direct USB 2.0 connections.  I know the device works with this machine because I also installed the Bluegiga SDK and ran its built in bluetooth scanning software which works fine.

 

At this point I wonder if using some more general purpose method of allowing me to connect to a BLE device via labview is possible.  I know BLE isn't support directly in labview 2018.  As per this link https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LuHSAU&l=en-US  I haven't tried their solution 1, but it might be what I have to do.  I wish I could find some example code of this to get me started.  As far as I know this would allow me to use any BLE dongle provided it uses the standard windows BLE stack drivers.

 

Thanks for the responses. 

MaximeR
Active Participant
Active Participant
on

Hello,

 

Ok. Just for information, I'm just a user of the toolkit.

Please do the test with MAX on your computer, I noticed that it was working with Blugiga SDK, but if it doesn't work in MAX, this can show that you have a problem with VISA Driver.

Use the WIndows DLL can be a solution. In this case, you must have a dongle that can connect to your device in BLE directly from Windows Stack. This dongle cannot do that I think.

 

Best regards

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

lightstring
Member
Member
on

So I have only used NI MAX one time before so forgive my ignorance.  I can see the device in Device Manager but nothing appears under My system in MAX.  Is there some other installation I am missing?

 

nimax.PNG

MaximeR
Active Participant
Active Participant
on

This is maybe the problem.

 

In MAX, you must have something like that :

temp01.png

I think that you must reinstall NI VISA on your computer. make sure to install the full VISA not only Runtime.

Under Software, you have the list of acutal NI Software. Can you chack what version of VISA you have. In my case I have NI VISA 17 and NI VISA runtime 17 :

temp02.png

Best Regards

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

lightstring
Member
Member
on

That was it.  Thanks!

MaximeR
Active Participant
Active Participant
on

You're welcome.

Maxime R.  

  CLA - Certified LabVIEW Architect / Architecte LabVIEW Certifié
  CTA - Certified TestStand Architect / Architecte TestStand Certifié

amberchang
Member
Member
on

hi rCassani,

Could you make the toolkit accessible for users with Labview 86?

dadest100
Member
Member
on

Hi everyone,

 

Thanks to @rCassani for making this package accessible to everyone. It really helped me a lot in my application and have a BLE monitoring system running now. 

 

However, I have two issues. 

One is the interval speed, I have one of my BLE characteristics assigned to the value of the output of my sensor. I am trying to use a fast sampling rate but when I modify the Connection Interval times in the ble_connect_to_device.vi, I get an error if I use an interval smaller than 8ms. the VI will simply not connect to my BLE module and output an error. Has anyone been able to use a smaller connection interval than 8ms?? How would you do this?

 

The second issue is that my device will be fully implantable, I have done some testing implanting the device and the signal intensity drops a lot. The BLED112 reading intensity is not enough and the device has to be too close to the dongle to be able to connect when implanted. Has anyone try different alternatives to the BLED112 that work with this LabView package??

 

Cheers, any help will be appreciated. 

 

David

NickNZ
Member
Member
on

Hi

Thanks to @rCassani for OS package - it saved a lot of time as I know it will cope with other Bluetooth packets (.e.g wireless headphones) as well as the UUTs I am trying to test. 

However, ble_parse_scan_response gave me some issues. Client has a BLE device that returns a Non Connectable Advertisement packet with some data bytes. 

1) Why is the length parameter not used to determine length of the remaining bytes?

2) In my case the UUT serial number is returned in this data so 0x02 is likely to be a valid number and cause truncation of returned bytes. (Else have to escape 0x02 byte)

3) if 0x02 is not found, then first array is empty -> Empty Friendly name -> looks like my UUT tags are not responding with any data - but I figured out this was the problem as I could see the tags responded from their "random" MAC addresses. 

 

Current implementation:

 

ble unused length.png

What works for me...

 

ble use length.png

All things going well, my understanding is that the length and remaining bytes should be equal. 

 

Cheers

Nick

bselekar_fta
Member
Member
on

Hi, 


I must implement pairing with the device using a passkey? Using a MAC (MM:MM:MM:MM:MM:MM) and six-digit pin (DDDDDD).
Can anyone help me?

 

Regards, 

 

Blaz 

Contributors