(ENGLISH)
I have a problem that I need to make a connection between my "AT-09" bluetooth module and my mobile phone. I am using the "Light Blue" mobile software to send messages to the serial monitor of the arduino and it gives me an error saying "Failed to write feature correctly. State: 10" and I tried to send the HEX code "68656C6C6F", because it should send " Hello", but it doesn't. Can anyone help me with this, because I'm new to this Arduino world and I really don't understand much, and I'm stuck at this point for a long time and this is only the first step, because after this i have to connect this module to a motor nema 17 and his respectiv driver "TMC 2208" using MIT APP INVENTOR, if anyone knows the solution of this problem, maybe using other software or other method.
PD: I´m using an arduino nano and after this i'm sending the code that i use to send the AT Commands.
(ESPAÑOL)
Tengo un problema que necesito hacer una conexión entre mi módulo bluetooth "AT-09" y mi teléfono móvil. Estoy usando el software móvil "Light Blue" para enviar mensajes al monitor serial del arduino y me da un error que dice "Error al escribir la función correctamente. Estado: 10" e intenté enviar el código HEX "68656C6C6F", porque debería enviar "Hola", pero no lo hace. ¿Alguien puede ayudarme con esto, porque soy nuevo en este mundo de Arduino y realmente no entiendo mucho, y estoy estancado en este punto por mucho tiempo y este es solo el primer paso, porque después de esto tengo conectar este módulo a un motor nema 17 y su respectivo driver "TMC 2208" usando MIT APP INVENTOR, si alguien conoce la solución a este problema, tal vez usando otro software u otro método.
PD: Estoy usando un arduino nano y luego de esto envío el código que uso para enviar los Comandos AT.
CODIGO-CODE:
SoftwareSerial mySerial(10, 11); // RX, TX
int PIN_EN_OUT = 4;
int PIN_STATE_IN = 5;
void setup() {
// put your setup code here, to run once:
mySerial.begin(38400);
Serial.begin(38400);
sendCommand("AT");
sendCommand("AT+ROLE0");
sendCommand("AT+UUID0xFFE0");
sendCommand("AT+CHAR0xFFE1");
sendCommand("AT+NAMELightBlue");
}
void sendCommand(const char * command){
Serial.print("Command send :");
Serial.println(command);
mySerial.println(command);
//wait some time
delay(100);
char reply[100];
int i = 0;
while (mySerial.available()) {
reply[i] = mySerial.read();
i += 1;
}
//end the string
reply[i] = '\0';
Serial.print(reply);
Serial.println("Reply successful");
}
void readSerial(){
char reply[50];
int i = 0;
while (mySerial.available()) {
reply[i] = mySerial.read();
i += 1;
}
//end the string
reply[i] = '\0';
if(strlen(reply) > 0){
Serial.println(reply);
Serial.println("Houston we have a signal!");
}
}
void loop() {
readSerial();
delay(500);
}