0

I'm completely new to Arduino, so please forgive me if something I ask here sounds stupid. So I have this Arduino UNO & Arduino compatible GSM-GPRS-GPS Simcomm SIM808 module that I'm working with. I want it to communicate with a Web server, but I can't even get it to start.

Following is my Arduino code:

#include<SoftwareSerial.h>

SoftwareSerial mySerial(2,3);




void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  mySerial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("Starting GSM...");
  mySerial.println("AT");
  Serial.println(getResponse());
  mySerial.println("AT+CSTT=\"TATA.DOCOMO.INTERNET\",\"\",\"\"");
  Serial.println(getResponse());
  mySerial.println("AT+CIFSR");
  Serial.println(getResponse());
}

String getResponse(){
  while(!mySerial.available()>0);
  return mySerial.readString();
}

And this is what I'm getting:

Starting GSM...
AT

OK

AT+CSTT="TATA.DGCOMO.INTERNET","",""

ERROR
ÿ
AT+CIFSR

ERROR

Starting GSM...
AT

OK

AT+CSTT="TATA.DOCOMO.INTERNET","",""

ERROR

AT+CIFSR

ERROR

Starting GSM...
AT

OK

AT+CSTT="TATA.DOCOMO.INTERNET","",""

ERROR

AT+CIFSR

ERROR
ÿÿÿÿ
Starting GSM...
AT

OK
ÿ
AT+CSTT="TATA.DOCOMO.INTERNET","",""

ERROR

AT+CIFSR

ERROR

I have no clue why it's happening & why I'm getting those ÿÿ in the result.

Auro
  • 1,578
  • 3
  • 31
  • 62
  • Take a look at this, it might help you: https://github.com/helmutkemper/__old_ArduinoRobot/blob/master/Codigos/GPRS_PACHUB/GPRS_PACHUB.pde – Rasmus Friis Kjeldsen May 23 '16 at 08:29
  • While I cannot say why AT+CSTT fails, I can give some tip on how to fix your response handling (which at least is present, good start). Using `while(!mySerial.available()>0)` will **never** work reliably; it is doomed to fail on you sooner or later. You must change to parse the response from the modem on a strict line by line basis. If the modem only sends you half a line you should block until the complete line is received. See [this](http://stackoverflow.com/a/36899432/23118) answer for details. – hlovdal May 23 '16 at 21:35
  • You might get some useful details in the error responses by running `AT+CMEE=2`, although be aware that sometimes they are not that accurately describing the core problem and must be taken with a grain of salt. – hlovdal May 23 '16 at 21:38
  • What is firmware version of SIM808? how about putting some delay between AT commands and serial response? – Studuino Aug 29 '17 at 08:31

2 Answers2

3

I had the same problem where I received ERROR after executing AT+CSTT="APN" . The APN cannot be changed when AT+CIPSTATUS is in "IP START" state. Deactivate the PDP Context with AT+CIPSHUT so that the AT+CIPSTATUS is in "IP INITIAL" state. Then run the AT+CSTT="APN" again.

ee04395
  • 31
  • 5
0

ÿÿÿÿ This string appears when you restarts the SIM modem since you are getting it in the middle of your program, it is probably caused by insufficient power supply.