[Moved] Gprs Socket Server With Sim900 and Arduino

Status
Not open for further replies.

Dimitris KOutsos

Newbie level 1
Joined
Apr 16, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
7
I have Gsm shield sim900 and I try to create a TCP server but the Server no response..
Mainly I want to create TCP server the gprs Shield and then send data to the client.

My Code is :

Code:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8);
void setup()
{
mySerial.begin(19200);               // the GPRS baud rate   
 Serial.begin(19200);    // the GPRS baud rate
 delay(500);

 mySerial.println("AT+CSQ");    //Signal Quality Report
 delay(2000);
 ShowSerialData();


 mySerial.println("AT+CREG?");  //Attach or Detach  from Gprs Service
 delay(2000);
 ShowSerialData();
 
 
 mySerial.println("AT+CGATT?");  //Attach or Detach  from Gprs Service
 delay(2000);
 ShowSerialData();
 
 
mySerial.println("AT+CGATT=1");  
 delay(2000);
 ShowSerialData();
 
 
   mySerial.println("AT+CGDCONT=1,\"IP\",\"INTERET\" ");
 delay(2000);
 ShowSerialData();

 
   mySerial.println("AT+CIPCSGP=1,\"INTERNET\",\"\",\"\"");
 delay(2000);
 ShowSerialData();
 


  mySerial.println("AT+CSTT=\"INTERNET\",\"\",\"\"");
 delay(2000);
 ShowSerialData();


 
  mySerial.println("AT+CIICR");
 delay(2000);
 ShowSerialData();
 
  mySerial.println("AT+CIFSR");
 delay(2000);
 ShowSerialData();
 
 
  mySerial.println("AT+CLPORT=\"TCP\",\"5000\"");
 delay(2000);
 ShowSerialData();

 
 mySerial.println("AT+CIPSERVER=1,5000");
 delay(2000);
 ShowSerialData();



  mySerial.println("AT+CIPSTATUS");
 delay(2000);
 ShowSerialData();
 
 




}
void loop(){

if (Serial.available()){

switch(Serial.read()){
case 't':
     mySerial.println("AT+CIPSTATUS");
     delay(2000);
     ShowSerialData();
     
       mySerial.println("AT+CIPSEND");
     delay(2000);
     ShowSerialData();
     
   break;
}

}
}
void ShowSerialData()
{
 while(mySerial.available()!=0)
   Serial.write(mySerial.read());
}

The AT+CIpStatus it Says STATE: SERVER LISTENING but when i try to ping the Ip i take no answer any idea?
 

Have you solved this?
I'm asking because I have the same problem. My suspicion is the GSM operator blocks inbound TCP connections.

But a friend of mine is using a PC with an USB GSM modem configured as a SERVER. And it works!
Will try to borrow his SIM card to do some tests.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…