0
votes

I Am using Arduino UNO and SIM900A module for GSM + ARDUINO based communication.I used following code to call a specific number but nothing happens,

void setup()
{ 
 Serial.begin(9600);
 delay(10000); 
}
void loop()
{
 Serial.println("ATDTxxxxxxxxxx;"); //where xxxxxxxxxx is  a 10 digit mobile number
 delay(30000); // wait 20 seconds.
 Serial.println("ATH"); // end call
 do // remove this loop at your peril
 { 
 delay(1); 
 }
 while (1>0);
}

whereas when i used ATDTxxxxxxxxxx; in minicom while communicating with SIM900A module, i was able to call(AS ATDxxxxxxxxxx was giving No carrier error, so i used " ; ").Similr is the case with Sending message. I am getting "+CMS ERROR: 302" while i am using

AT+ CMGF=1 
AT+CMGS="Mobno." //after this i get the error.

I am not able to send the message through minicom + SIM900A GSM module and i want to test it with Arduino.I think i am having some problem with settings of SIM or either module.I even tried to reset the settings of SIM , but nothing worked out.

3
Try to follow the information in the tutorial at cooking-hacks.com/index.php/documentation/tutorials/… Also pay attention to the LED blink codes on the module. Google "SIM900A arduino" for lots of informationuser2019047

3 Answers

0
votes

First of all: never, never ever use delay instead of proper waiting by parsing the actual response given by the modem. And you must read back the responses given by the modem and wait for the final result code before proceeding to the next command. See this answer and this answer for more details (especially regarding proper AT+CMGS handling).

A list of all the CMS ERRORs are defined in 27.005 in the section 3.2.5 Message Service Failure Result Code +CMS ERROR. Does your subscription allow sending SMS (most likely, but just to be sure check this. Test sending an sms using this sim inserted into another mobile phone)? What message storage are you using? Are you sure the gsm module supports text mode?

0
votes

I solve the problem just use this code:

void setup()
{ 
  Serial.begin(9600);
  delay(10000); 
}
void loop()
{
  Serial.println("ATD+60148266823;"); //where xxxxxxxxxx is  a 10 digit mobile number
  delay(30000); // wait 20 seconds.
  Serial.println("ATH"); // end call
  do // remove this loop at your peril
  { 
    delay(1); 
  } while (1>0);
}
0
votes
void setup(){ 
    Serial.begin(9600); 
} 
void loop(){
    Serial.println("AT");
    delay(500);
    Serial.print("ATD");
    Serial.println("99XXXXXXX8;");
    delay(20000);
    Serial.println("ATH");
}