Hello,
I use the module Grove BLE with Arduino Mega 2560, to communicate with my Android 4.3 phone (Galaxy S3 with HMBLEComAssistant.apk).
The problem is that the name of the BLE module (default: HMSoft) doesn’t change with the command “AT+NAMEnew_name” and I don’t receive feedback from the AT commands sent via serial interface (such as “AT+ADDR?”).
I tried to send commands with and without carriage return.
Any idea?
The code I use:
void setup()
{
Serial.begin(9600);
setupBleConnection();
}
void loop()
{
char recvChar;
if(Serial1.available()) {
recvChar = Serial1.read();
Serial.print(recvChar);
}
if(Serial.available()) {
recvChar = Serial.read();
Serial1.print(recvChar);
}
}
void setupBleConnection()
{
Serial1.begin(9600); //Set BLE BaudRate to default baud rate 9600
Serial1.println("AT+CLEAR"); //clear all previous setting
Serial1.println("AT+NAMEnew_name"); //set new name
Serial1.println("AT+ROLE0"); //set the bluetooth name as a slaver
Serial1.println("AT+SAVE1"); //don't save the connect information
}