HC-06 Bluetooth Module not working after chaning Baud rate

Hello, I got an hc06 Bluetooth module and was experimenting different baud rates.
I set baud rate to 1200 using command AT+BAUD1 and then can't communicate again with the module neither recieve OK fromt AT command, just getting garbage symbols when viewing sent and recieved messages from bluetooth terminal app on the phone.

This is the code i am using

#include <SoftwareSerial.h>
SoftwareSerial bl(5,4);

void setup() {
  // put your setup code here, to run once
 Serial.begin(9600);
 Serial.println("Enter AT Commands:");
 bl.begin(1200);
}

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

Is there any way to hard reset the module to default baud rate?
Thanks in Advance.

The web search phrase "hc-06 factory reset" turns up some suggestions.

Searched a lot didn't find a working way. All the tutorials need AT Commands to be working first to be able to factory reset.

Came across this instructable Recover Misconfigured HC-06 Bluetooth Module : 4 Steps - Instructables and used the tool mentioned in step 4 to match my case (baud rate 1200) but the generated code came too long and arduino ide can't compile it. Tried to use arduino cli to upload the code without compiling but it keeps saying cannot find compiled file.
Note : ide keeps compiling for about 1-2 ish hours to give me and error same as arduino cli

just getting garbage symbols when viewing sent and recieved messages from bluetooth terminal app on the phone.

That's because the baud rate of your other device (red. Phone, other HC-05, etc.) isn't the same baud rate. You can demonstrate this easy with your computer, if your Arduino sends text or really any data, you can change the baud rate of your computer. If it isn't the same as the Arduino, you'll get weird stuff. So I am not sure what the other device is (and if you can change the baud rate on that device) but it is clearly pinned at the original baud rate at this moment.

Why do you want to lower the baud rate? 9600 is already a low rate, 1200 is much worse, why not 115200 or something much higher?

Because i had a code that sends a value that changes and sent every 200ms of delay to a mobile application when i lower the delay to 100ms the app on the phone freezes and suddenly the numbers starts changing so fast and connection is lost so i was testing different baud rates to see of this is the issue

What phone are you using, because a HC-05 doesn't support Ble, but Ble is more mature and energy effective. This isn't substantiated: I have fewer issues with Ble than with Bluetooth, so is it a possibility to change?

You can change the baud rate of an Android, but it is a whole operation where it looks every second that your phone is going to die, so if you can avoid that, please do.

It is a xiaomi redmi note 10 pro which support bluetooth 2.0 protocol

It is an hc-06 module still doesnt support BLE but wanted to clarify this

It is an hc-06 module still doesnt support BLE but wanted to clarify this

Sorry, but they should work almost the same. The largest difference is that the HC-05 can be a host and the HC-06 can't.

So you got this forum topic on Stackoverflow where they tried to change the baud rate of an Android: Stackoverflow. I haven't tried it myself, but it looks like a lot less pain than what I tried (and it didn't work in the end). It still looks like hell though.

i am not into android coding actually i used MIT Inventor and there is no option there to change the baud rate in the app

Okay, no problem. But I think that you'll have to stay at the default baud rate.

I had tried using the HC06 bluetooth for comms off an Arduino MEGA a couple years ago and couldn't get it to work. I fought with it for a long time!

I found that the protocols were in compatible with modern equipment that it was to interface with. I ended up adding an ESP32 which worked well (& comms from the MEGA to the ESP32).

Sir Michael

I think i will be getting an esp32 at the end.
btw how the esp32 behaves with you when sending messages with short delay between ex:10-20ms.
I want to display my car RPM in real time on the phone with high refresh rate, i tried with the hc06 (when it was working) but it keeps losing connection when using small delays between each rpm value sending

Make sure to check if the ESP32 is compatible with all your libraries, because that isn't always the case.

I'm sure that you'll find that the ESP32 is very considerably faster than most of Arduino devices.

I used an M5Stack ($50-$60) which includes a touch display, speaker, Bluetooth, Wifi, hardware comms and a lot of other things. There are also add on cards that will extend the functionality, I believe there is also a CanBus card:
CANBus Unit(CA-IS3050G) | m5stack-store

If you do use an M5Stack make sure you start with the M5Unified.h library. They used to have drivers for each individual board, but then someone else bought it out and started creating a single driver for ALL M5Stack models.
I started my current project by mounting an ESP32 in a case, a display, amplifier/speaker, relays and much more. Then I discovered the M5Stack that had nearly everything that I needed in one nice neat (replaceable) package!

Another thing that I might consider is a CYD (Cheap Yellow Display):
cyd | Random Nerd Tutorials

There are actually quite a few different boards that are available with an ESP32 and display that are quite inexpensive that might work well for your project. You'll just need to come up with something of a case and mounting for it.

As for Drivers that siebe mentioned, you may have to do some research to get the compatible drivers. You may need to learn a bit about graphical programming, although you could stick to text output as well.

OH! I just found this:
The ESP32 has an integrated CAN bus controller, also known as TWAI (Two-Wire Automotive Interface), which allows it to communicate over the CAN bus protocol commonly used in automotive applications. This feature enables the ESP32 to send and receive messages, making it suitable for projects involving vehicle data monitoring and control.

New to me too!!! Best of Luck.

Sir Michael

That is awesome to know that esp32 support CAN communication but unfortunately my car is classic with mechanical ignition.I managed to calculate the rpm using an optocoupler connected to the negative side of the ignition coil and calculating the time between each low event.
So my issue now is to display the RPM on android app with high refresh rate i dont know if esp BLE will handle fast sending of the data or not

You mean the libraries on ArduinoIDE?

I can’t tell you exactly how it will react, you’ll just have to try it.

“You mean the libraries on ArduinoIDE?“
Yes, the M5Stack Arduino libraries.

Sir Michael

Okay i think i will give a try if hc06 didn't work.
Thanks Guys!