My project is now fishished and I'm able to communicate with my Arduino through an application developed on Android.
Everything is working well
My only issue is... since the begegning of my project, I'm not able to send AT command to the HC06 to configure it
My serial is working because tested with BT communication
My HC06 is not connected (its led is blinking)
I've tried;
all speeds 1200 to 115200.
For BT communication, I discovered my HC06 is using 38400 Bauds by default.
with and without CR LF
Lower and Upper cases
The HC06 never answer to any AT commands and more... I read the HC06 led bliking duration can change when AT commands received but on my side, the blinking is regular and never change.
Does it mean it never receives anything?
I'm lost but I don't want to keep the HC06 default name and PIN...
And you don't need one either. The HC-06 is in AT mode by default until something connects to it - hence only four pins. Use 9600 only, irrepective of the speed used for comms.
Yes, it was my understanding but even at 9600 without using any specific pin, my HC06 never answer.
My previous post was for Terry who gave me a link to details about HC05 module.
Terry should know better. Check the Martyn Currey website. He is the guru that really knows what configuring is all about.
I am surprised your HC-06 is communicating at 38400 by default but, be that as it may, it is configured at 9600. The fact that you have it working means that your wiring is kosher, and the four pins confirms it is indeed an HC-06. I believe the LED flash changes to slow (0.5Hz) on confirmation of AT command, but I'm afraid I can't remember.
I recommend posting a picture of your physical wiring and BT module. You should also try using the following code from Martyn's website:
// Basic Bluetooth sketch HC-06_01
// Connect the Hc-06 module and communicate using the serial monitor
//
// The HC-06 defaults to AT mode when first powered on.
// The default baud rate is 9600
// The Hc-06 requires all AT commands to be in uppercase. NL+CR should not be added to the command string
//
#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // RX | TX
// Connect the HC-06 TX to the Arduino RX on pin 2.
// Connect the HC-06 RX to the Arduino TX on pin 3 through a voltage divider.
//
void setup()
{
Serial.begin(9600);
Serial.println("Enter AT commands:");
// HC-06 default serial speed is 9600
BTserial.begin(9600);
}
void loop()
{
// Keep reading from HC-06 and send to Arduino Serial Monitor
if (BTserial.available())
{
Serial.write(BTserial.read());
}
// Keep reading from Arduino Serial Monitor and send to HC-06
if (Serial.available())
{
BTserial.write(Serial.read());
}
}
Yes, your wiring is bad. The resistor divider connections are all in the wrong place. One resistor doesn't even seem to be connected to any part of the circuit at all! In short, the Arduino TX isn't connected to the Bluetooth's RX.
Yes, your wiring is bad. The resistor divider connections are all in the wrong place. One resistor doesn't even seem to be connected to any part of the circuit at all! In short, the Arduino TX isn't connected to the Bluetooth's RX.
Are you sure?
Find attached my picture but with details because not so readable...
In add, my real application is working. I can use the HC06 through Bluetooth communication.
So, RxD and TxD are correctly connected. It's my assumption
Only the HC06 setting through AT commands is not working