Go Down

Topic: AT COMMANDS to HC-06 (Read 230 times) previous topic - next topic

DeltaElectronics

Hello to everybody;
I use the following sketch in order to send, through IDE serial interface, the AT commands to my HC-06 bluetooth module:
Code: [Select]

#include <SoftwareSerial.h>
int times;
int rxPin = 3;
int txPin = 2;
SoftwareSerial hc06(rxPin, txPin);

String message; //string that stores the incoming message
char ch;
void setup()
{
 Serial.begin(9600); //set baud rate
 hc06.begin(9600); //set baud rate
}

void loop() {
 // put your main code here, to run repeatedly:
 if(Serial.available())
 {
   ch = Serial.read();
   hc06.write(ch); 
   Serial.write(ch);
 }
if(hc06.available())
 {
   Serial.write(hc06.read()); 
 }
}

And it works fine, but I am not able to see, in the serial interface (Putty or others) any reply from it.
For example if I try to send the following AT command
AT+NAMESopwithCamel
Then the HC-06 module is now seen, by my mobile for example, like as 'SopwithCamel' but any replies appears in my serial interface, nor OK nor 'SopwithCamel' appear if now I try to send the AT Command
AT+NAME.
I tried the same sketch to an HC-05 module and it works fine instaed.
Could someone help me ?
Thanks to everybody will reply me.


Go Up