Go Down

Topic: How can we work with AT+SDATASTATUS (Read 440 times) previous topic - next topic

PaulS

Code: [Select]
     cell.println("AT+CGDCONT=1,\"IP\",\"internet\"");
     status();

Send a command. Expect an instantaneous response. What world do you live in? Serial data transmission is ssslllooowww. You are allowing NO time for that to happen, for the other device to get, parse, react to, and respond to the data, or for the response to arrive back at the Arduino.

pierrot10

Hello,
Ok I understand what you means, but I could get the result I want to have
The first question which come to my mind, how long should I wait until I can get a respond. I tryed with 5sec

Taking inconsideration this

Code: [Select]
cell.println("AT+CGDCONT=1,\"IP\",\"internet\"");
delay();
     status();


I add delay(5000); just before status().
I also tried to add delay(5000);
here
Code: [Select]

static void status(){
   
     while(cell.available()){
        incoming_status=cell.read();
        delay(5000);
        Serial.print(incoming_status);
      }

}

But in all case, I have not a result for

Code: [Select]
cell.println("AT+CGDCONT=1,\"IP\",\"internet\"")

Cheers
Il ne suffit pas de tout savoir, la persévérance, c'est déjà presque tout!

PaulS

Waiting 5 seconds between bytes, when you KNOW there is data to read is silly.

Does the AT+CGDCONT command return a response? I would expect all commands to, but it might take more than 5 seconds for that command to return a response.

Go Up