I have a couple of questions regarding this. I searched a little, but didn't find something matched up.
I use Software Serial and connect to the computer using USB. The computer is Linux.
When I am in AT mode,
If I type in a command from the Arduino Serial Monitor, it would work like above (successfully change name, password), but the response is gibberish when I route that response back to the USB:
¯¥#á
However, when I connect at "data" mode, using a phone, sending data from the phone to the bluetooth, it routes successfully to the Arduino Serial Monitor, and I can read the text I sent from the phone successfully.
What do you think what causes the gibberish AT output?
The baud rate for data communication is 9600, for the AT mode is 38400
I also could not (or don't know) how to change the baud rate, I wonder what is the correct command to get it to work.
These didn't work (mess thing up until I get it back to 9600 ):
AT+UART_DEF=9600,8,1,0,0
AT+UART=115200,1,0
I also couldn't change the password to more than 4 characters.
Please help.
The sketch is from some tutorial:
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX | TX
void setup()
{
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(9600); // HC-05 default speed in AT command mode: 38400, default data mode baud rate: 9600
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
BTSerial.write(Serial.read());
}