Furkan O Furkan O - 23 days ago 7
C Question

Resetting the HC-06 Bluetooth module with Arduino Uno?

This is my first post on Stackoverflow so I hope you can answer my question.

I am fairly new to Arduino and I accidentally changed the baudrate and name of my HC-06 Bluetooth module with the following code.

#include <SoftwareSerial.h>

SoftwareSerial mySerial(3, 4); // RX, TX

void setup()
{
//Serial.begin(9600);
//Serial.begin(57600);
Serial.begin(115200);
Serial.println("Goodnight moon!");

mySerial.begin(9600);
//mySerial.begin(57600);
//mySerial.begin(115200); //if you change the baud and want to re-run this sketch, make sure this baud rate matches the new rate.

delay(1000);
mySerial.print("AT");
delay(1000);
mySerial.print("AT+VERSION");
delay(1000);

//mySerial.print("AT+PIN1234"); // Set pin to 1234 was 1342
//delay(1000);

//mySerial.print("AT+NAMEJY-MCU-HC06"); // Set the name to JY-MCU-HC06
//delay(1000);

//mySerial.print("AT+BAUD4"); // Set baudrate to 9600
//mySerial.print("AT+BAUD7"); // Set baudrate to 57600
mySerial.print("AT+BAUD8"); // Set baudrate to 115200
delay(1000);
}

void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}


Now I'm unable to revert back to the default settings (baudrate 9600 and name HC-06) and I don't how to fix this.

I tried entering serial AT commands but I get no response. I also made sure the HC-06 module is not paired with any other device, but still no response. I also tried different sources and terminals besides the Arduino Serial monitor, like:

http://www.hobbyist.co.nz/?q=bluetooth-module-device

http://42bots.com/tutorials/hc-06-bluetooth-module-datasheet-and-configuration-with-arduino/

And more...

So my question is as follows: How am I supposed to revert the changes I made to the HC-06 Bluetooth module, preferably back to baudrate 9600?

Thank you in advance.

-F

Answer

Okay, I feel so dumb...

Apparently I set the baudrate to 57600, not 115200... So now I was able to change the baudrate and name through the 57600 baudrate.

Well, I wont forget how it works now after this :P. Thank you all for your time and patience.

-F