Hi, i'm new to the Arduino world and also to AT commands. I know it has been discussed a lot but i need a bit of help.
I have made some code that can send the msg "AT" to hyperterminal, and some code that should detect if the "OK" comes back. This is working.
I have tested the the phone supports AT commands, and i have managed to send sms through Hyper Terminal. This is working.
I have made a cable connecting (phone -> arduino USB B-plug):
Pop port "D+" to Arduino "D-"
Pop port "D-" to Arduino "D+"
Pop port "Data Ground" to Arduino "Ground"
The cable is direct i.e. no level change. I actually don't know if this is ok !
Well - it doesn't work... When i connect the phone and the Arduino i do not receive any "OK" msg from the phone. I have tried different speeds any so, and it all seem to work betweem hyperterninal and the phone, and between arduino and hyperterminal.
any idea ? ... my code is below..
void setup ()
{
pinMode(13,OUTPUT);
Serial.begin(115200);
//Serial.println("ATZ&F");
//delay(5000);
//Serial.println("AT&K[0]");
//delay(2000);
}
void loop()
{
inCount = 0;
Serial.flush();
digitalWrite(13, HIGH);
Serial.println("AT");
do {
while (!Serial.available())
{
}
digitalWrite(13, LOW);
inString[inCount] = Serial.read();
if (inString [inCount] == INTERMINATOR) break;
} while(++inCount < INLENGTH);
inString[inCount] = 0; // null terminate the string
if(0==strcmp(inString,"OK"))
{
Serial.println("OK-Recieved");
digitalWrite(13, HIGH);
delay(200);
digitalWrite(13, LOW);
delay(1000);
digitalWrite(13, HIGH);
delay(200);
}
delay(10000);
}