Helloo everyone !
Im using a M10 GSM/GPRS Shield and I had to know how to get the time without using an external RTC, so i used AT command to get it, but the problem is that i have to use that incoming information, maybe store it into a variable !
so here is what Im using in the code :
void loop()
{
Serial.println("Sending AT Commands.");
send_command("AT+CCLK?",1000);
while(true);
}
void send_command(String AT_COMMAND, int tDelay){
Serial.print("COMMAND: "+AT_COMMAND);
Serial.println(modemAccess.writeModemCommand(AT_COMMAND,tDelay));
Serial.println("-----------------------------------------------");
}
and this is the response that Im getting over the serial monitor :
Connecting to the GSM network
Connected.
Sending AT Commands.
COMMAND: AT+CCLK?
+CCLK: "04/01/01,00:01:12+00"
OK
i want to store that : 04/01/01,00:01:12
any kind of help is appreciated !! thank youuu
We can assume that you implemented the suggested changes correctly, or we can assume that you butchered the code royally. Which do you think is more likely?
with char MYDate[18];
so
Im getting the same results as earlier :
Connecting to the GSM network
Connected.
Sending AT Commands.
COMMAND: AT+CCLK?
+CCLK: "04/01/01,00:01:12+00"
Are you using Serial to talk to the phone? Or are you using it to talk to the PC? Both is wrong answer. So is yes.
Once you read data from the serial port, and store it in MYData, you are not printing what is in MYData, so of course the results are going to be exactly the same.
find() reads data from the stream until the target string of given length is found The function returns true if target string is found, false if timed out.
So, wouldn't it be nice to know if find() found +CCLK: "? Before you assume that the rest of the data will be present?
yeah it would be so nice I agree !! but what if i still don't get anything new in return !
if you know how it should be done, can you pleaaaaaaaaaaaaaaaaase tell me, i need help because i still have a lot of things to do and not too much time ! i never used find() neither readbytesuntil and i didn't find how using it in arduino website reaally clear ! so please if you already know how, just tell me