Pages: [1]   Go Down
Author Topic: How can we work with AT+SDATASTATUS  (Read 298 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 0
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good evening,

I searched a lot on internet (sorry I ma a beginner) to know how to get a value of
Quote
AT+SDATASTATUS

My goal is to know the status of the connection in order to create a condition

if connection is good => continue
id connection is'nt => reconnect and execute AT' commands

Could you provide me an exemple of AT+SDATASTATUS with the Serial.print() of the retunr value/data?

Thank for your help
Logged

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

Sydney, Australia
Online Online
Edison Member
*
Karma: 27
Posts: 1179
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Google came up with this

http://www.sparkfun.com/datasheets/Cellular%20Modules/CEL-09533-TCPIP-APPNOTES-V1.1.pdf
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Sr. Member
****
Karma: 0
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Thank for your answer,
I already read that document. it help me, but in spite of this I still block, specialy to display teh result of SDATASTATUS.
It would better help if I can have an exemple in that way I can better understand that copying.

Thank
Logged

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

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 548
Posts: 46022
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
specialy to display teh result of SDATASTATUS.
Displaying the response to that AT command is the same as displaying the response to any AT command. How are you doing it for other AT commands?
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It still does not work.

I wish to display the result or status of each command, in order to make sure that all of them return me an OK.

Here is my code. Each command ate followed by status() function. I also add
Code:
cell.print("+SOCKSTATUS");
, but it does not show/display anythink

Code:
   Serial.println(F("Setting up PDP Context"));
     cell.println("AT+CGDCONT=1,\"IP\",\"internet\"");
     status();
     delay(1000);
     
     Serial.println(F("Activating PDP Context"));
     cell.println("AT+CGACT=1,1");
     status();
     delay(1000);
     
     Serial.println(F("Configuring TCP connection to TCP Server"));
     cell.println("AT+SDATACONF=1,\"TCP\",\"92.104.69.134\",81");
     status();
     delay(1000);
     
     Serial.println(F("Starting TCP Connection\n"));
     cell.println("AT+SDATASTART=1,1");
     status();
     delay(1000);
     
     Serial.println(F("Getting status"));
     cell.print("AT+SDATASTATUS=1");
     status();
   
    Serial.println(F("Display status"));
     cell.print("+SOCKSTATUS");
     status();

Here is my status() command
Code:
static void status(){
   
     while(cell.available()){
        incoming_status=cell.read();
        Serial.print(incoming_status);
      }
}

Please, help with exemple, it would be very nice from you.

Have a nice day.
Logged

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

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 548
Posts: 46022
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
     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.
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
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:
cell.println("AT+CGDCONT=1,\"IP\",\"internet\"")

Cheers
Logged

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

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 548
Posts: 46022
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: