Hi all,
I have a problem with pairing my AT-09 with my laptop.
I can see the AT-09 bluetooth signal, can insert the pin but the connection fails.
However, on my mobile phone with the app LightBlue, I can connect to the AT-09 and send and receive data. There, I do not have to insert a pin, which surprise me.
My windows laptop has BLE support and I tried to pair it via the default way "add bluetooth device" and a selfmade C# programm, but non of them worked.
Here is the AT-09 code:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 4); // RX, TX
void setup() {
// put your setup code here, to run once:
mySerial.begin(9600);
Serial.begin(9600);
sendCommand("AT");
sendCommand("AT+ROLE0");
sendCommand("AT+TYPE2");
sendCommand("AT+UUID0xFFE0");
sendCommand("AT+CHAR0xFFE1");
sendCommand("AT+NAMESTRIVE");
sendCommand("AT+PIN1234");
}
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");
delay(50);
}
void writeSerialToBLE(int value) {
mySerial.println(value);
}
void writeToBLE(char value) {
Serial.print("Writing hex :");
Serial.println(value, HEX);
mySerial.write(value);
}
char j = 0;
void loop() {
writeToBLE(j);
j += 1;
delay(500);
}
Has anyone an idea why I cannot pair my laptop with the AT-09?
Thank you
Alex