07-14-2020 12:35 PM
Hello. I've read a bunch of discussion boards on Bluetooth applications, but I'm afraid I'm even more confused now and still can't get my application to work. I have an Arduino Uno, HC05 Bluetooth module, and a Bluegiga dongle (which I'm not even sure if I need... Sigh...). I know the following:
HC05 device name: BT05
HC05 Mac address: 00:15:83:00:4A:41
HC05 UUID: (from AT command: 0xFFE0, but I can connect using the bluegiga software using 2A00)
HC05 is paired to my computer
Bluegiga dongle is attached to COM9
Arduino is attached to COM5
All I want to do is send the following string from LabVIEW to the HC05 module (the carriage returns need to be maintained):
x2,1]
15,15,2,2]
0,0,2,2]
I've tried just using the basic, built-in bluetooth vi's but I don't think the HC05 has a GUID (Basic_bluetooth.vi).
I've tried using the Bluegiga dongle in two different ways (using the vi package that you download and install and then not using the vi package). bluetooth_arduino_connection_v1 and v2.vi
I know that the Bluegiga is able to connect to the HC05 because I've used the ble_scan_devices.vi available at the recommended website (https://forums.ni.com/t5/Community-Documents/LabVIEW-BLE-Bluetooth-Low-Energy-toolkit/ta-p/3538612)
From viewing the serial port of the arduino, it never receives any string (let alone the string I want). What am I doing wrong?
07-15-2020 09:36 AM - edited 07-15-2020 09:46 AM
I suggest you get your program working using the USB connection first.
As once that is working it will be simple to replace the USB with the Bluetooth connection.
Everything you ever wanted to know about the HC05
07-22-2020 10:56 AM
Hi, I'm still having some problems accomplishing #4 and #5 from your reply. We'll start with #5:
5. I was able to get my program to work through the USB connection through COM5 to the Arduino board.
The program works beautifully.
However, when I try to add in the Bluetooth connection to my Arduino program, I get an error code -1073807339. Source "VISA Read in text_send_L_A.vi" My Arduino code for the bluetooth connection added is "Bluetooth Connections.txt"
Part of the problem is that I don't understand how to accomplish #4 from your suggestion. I know that my device is paired to my computer, but I really don't understand what you mean by the "HC05 becomes 'transparent'". How am I supposed to connect to it? What's the COM port number/what am I supposed to wire to the VISA resource name of the VISA configure serial port vi?
I attached two pictures showing that my HC05 (named BT05) is paired and the port numbers in device manager. I tried port 6 but that's what leads to the error mentioned above.
07-22-2020 01:53 PM - edited 07-22-2020 02:05 PM
My first question is why are you using software serial? Frankly I have never used the software serial so you are on your own and that's not a LabVIEW issue.
Oh BTW: Have you setup the HC-05 its self, set the baud rate, etc..?
07-22-2020 02:34 PM
I'm using software serial because it was part of the original program. What I'm trying to do is take a program that communicated via bluetooth from an app on an iPhone and integrate it with a bunch of other sensors that I'm controlling through LabVIEW (that way I only have one user interface). I'm decently competent at LabVIEW. I'm not competent at Arduino (Gah!!!).
I did what you said and it's still not working. The HC05 is setup, and it works well with the iPhone. I think the problem is that it isn't establishing a virtual port when it pairs. COM6 is an incoming port. Should it be outgoing? Sorry for my ignorance.