Why you are repeatedly sending a command to set the time is a mystery. That should be done ONCE, in setup().
Thanks for your tips, I will do as you said, setting the time at the setup(). and this program will only be done one time before I upload my project code. And GPRS/GSM Shield will be on power all time to keep its RTC run.
The response is supposed to end with some kind of value that says "this is the end of the reply". You need to wait, in a while loop, for that character to arrive BEFORE you send another command.
I changed the wait time to 2000(2s),and it works well . but the result also have a little problem.
SoftwareSerial mySerial(7, 8); // RX, TX
// Open serial communications and wait for port to open:
// set the data rate for the SoftwareSerial port
void loop() // run over and over
mySerial.println( "AT+CCLK =\"12/12/27,10:43:50+08\"");
mySerial.println( "AT+CCLK?" );
The result shows AT+CCLK ="12/12/27,10:43:50+08"
There also are many A
.Can you tell me why does this happen?