Asking yourself why the HC-06's status LED keeps blinking after pairing with your PC?.
Asking yourself why after entering "1234" pairing code the HC-06 status changes to "Connected" and then to "Paired" after just few seconds?.
The answer is: THIS IS NORMAL.
I recognize that I was expecting the HC-06 module status to behave as my Bluetooth speakers or my Bluetooth headphones after pairing: Always connected. Wrong!!!.
After dealing with the communication problem between the HC-06 Bluetooth module and my Windows 10 PC, I unexpectedly got the connection and solve the problem.
After many fails, I focused in test the wiring between the Arduino UNO and the HC-06 module. For this I decided to send from the Arduino an AT command to change the module's name from "HC-06" to "ArduinoBT01" and it worked. So I isolate the problem to the HC-06 and PC side.
I'm assuming that you're familiar with the Arduino stuff. You got here because you're dealing with the HC-06 communication and you should have a good level. Anyway feel free to ask in the section at the end of this post.
This is how I got the communication:
1) This is the sketch I used as a test to send data to the PC via the HC-06:
I keep it very short and simple. The FOR cicle is just because I like to see things changing in the terminal screen.
1) This is the sketch I used as a test to send data to the PC via the HC-06:
2) Pairing the HC-06 module with my PC: During the pairing process the status of the module in the "Manage Bluetooth devices" dialog window were, in sequence, as follow: "Ready to pair", "pairing" (here is when the manager asks for the "1234" code), "Connected" (just for few seconds) and then "Paired". Before, during and after this sequence the HC-06's status LED was blinking.
After pairing the HC-06 module, I got two new com ports: COM34 and COM35 (this may be different in your setup). The right com port to open and receive the data in the PC is the one indicated with direction "Outgoing" in the PC's Bluetooth settings as follow:
After pairing the HC-06 module, I got two new com ports: COM34 and COM35 (this may be different in your setup). The right com port to open and receive the data in the PC is the one indicated with direction "Outgoing" in the PC's Bluetooth settings as follow:
Yes, believe or not, to receive the data you must open the "Outgoing" port. This sounds illogical to me. During my firsts tests I wasted a lot of time trying to catch the data from the "incoming" COM35 port.
3) Monitor the received data in the PC: I like to use CoolTerm to monitor and/or catch the data from the COM ports. As soon as I opened the COM34 port to receive data, the HC-06's status LED changed to a BEAUTIFULL SOLID ON.
As soon as I closed the connection, the LED changed to blinking again.
So, the LED will be solid ON only while the outgoing COM port is opened and under control of CoolTerm during the data transmission from the Arduino.
Take a look of the COM34's configuration shown in the bottom of the CoolTerm window. Mysteriously, the CoolTerm speed setting was 14400bps and the speed in the device manager for COM34 was 9600bps. Every time I tried to open the COM34 port with 9600bps, I got this error:
I did never set the speed to 14400bps, I guess it was done automatically by CoolTerm and after that I got unexpectedly the received data. After others tests I found that it only works with 14400bps. Crazy bug!!. I will test this with puTTY.
My tests were limited to send data from the Arduino to the PC. I will be conducting more tests sending data to the Arduino.
I hope this helps!!
All comments are welcome (English or Spanish)
(Sorry for bugs in my English)
PD: Other useful tools that help me a lot to finally get the communication after wasting my time with the COM35 port were: TUMS and famotidine.
No comments:
Post a Comment