0

I have setup a arduino with a SIM300 based GSM board. I have

Tx of Arduino connected to the Rx of GSM board

Rx of Arduino connected to the Tx of GSM board

Gn of Arduino connected to the Gd of GSM board

The GSM has a Vodafone 3g sim, activated with 3g. The GSM board has 2 LED's, one remains ON and the other blinks ever 4-5 seconds. Which I guess means that its configured to work with the SIM.

I then run the following code.

SoftwareSerial mySerial(10, 11); // RX, TX
void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  mySerial.begin(9600);

  Serial.println("Serial ports initialized");
 
   delay(500);
   Serial.println("AT+CGATT=1");
   delay(500);
   Serial.println("AT+CGDCONT=1,\"IP\",\"TATA.DOCOMO.INTERNET\",\"0.0.0.0\",0,0");
   delay(500);
   Serial.println("AT+CDNSCFG=\"8.8.8.8\",\"8.8.4.4\"");
   delay(1000);
   Serial.println("AT+CSTT=\"TATA.DOCOMO.INTERNET\",\"\",\"\"");
   delay(2000);
   Serial.println("AT+CIICR");
   delay(5000);
   Serial.println("AT+CIFSR");
   delay(500);
   Serial.println("AT+CIPSTATUS");
   delay(500);
   Serial.println("AT+CDNSORIP=1");
   delay(500);
   Serial.println("AT+CIPSTART=\"TCP\",\"http://myec2DNS-us-west-2.compute.amazonaws.com:myportnumber/mywebservice/myreques/Authentication/Request?identity=somecode&identityType=sometype\",\"myportnumber\"");
   delay(500);
   Serial.println("AT+CIPSEND");
   delay(500);
   Serial.println("AT");
}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}

On cutecom I get te following

Serial ports initialized
AT+CGATT=1
AT+CGDCONT=1,"IP","TATA.DOCOMO.INTERNET","0.0.0.0",0,0
AT+CDNSCFG="8.8.8.8","8.8.4.4"
AT+CSTT="TATA.DOCOMO.INTERNET","",""
AT+CIICR
AT+CIFSR
AT+CIPSTATUS
AT+CDNSORIP=1
AT+CIPSTART="TCP","http://myec2DNS-us-compute.amazonaws.com:8080/myservice/mycommand/Authentication/Request?identity=%somecode&identityType=1","8080"
AT+CIPSEND
AT

When I run `tail -f /var/lib/tomcat7/logs/localhost_access_log.2014-09-20.txt' on my webserver, I get nothing from the arduino.

What am I missing here ?

1 Answer 1

1

it seems like you are using the wrong serial interface. I see Serial and mySerial.

After mySerial.begin() you write to Serial, not to mySerial which runs on pins 10 and 11.

What's when you send the AT Commands from your Serial connection to the Arduino? It Should redirect them to the GSM board.

4
  • I welcome your answer. Shouldn't the loop method take care of that ? I did also get OK's for all AT commands.
    – Siddharth
    Sep 23, 2014 at 4:27
  • The loop() redirects incoming commands from Serial to mySerial and vice versa. If i'm not mistaken the AT Commands in setup() are sent to your computer and not to the GSM module. Where does the OK's come to?
    – Clijsters
    Sep 24, 2014 at 10:38
  • The OK's come on the cutecom ttyUSB0. I think its working that way.
    – Siddharth
    Sep 24, 2014 at 11:05
  • You might want to implement error handling for the AT commands. Though if you believe this answer has fixed your question press the ✔ below the ⇩ on the left side of the question.
    – Paul
    Apr 21, 2015 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.