Sim800l EVB v2 Can do voice call but AT command not working

HI,I am using sim800l EVB v2 with my arduino UNO. I can call to a number successfully,but at command not responding.So i am unable to send sms.
Is there any way?My sim800l is blinking @3sec means it has network & i can call to a number.when i call from my mobile to sim used gsm module ,i can also hear ringing on my phone.The Only problem is I cant interact and unable to send SMS.
Here is the code.

#include <SoftwareSerial.h>

//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial( 2,3); //SIM800L Tx & Rx is connected to Arduino #2 & #3

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);
  
  //Begin serial communication with Arduino and SIM800L
  mySerial.begin(9600);

  Serial.println("Initializing..."); 
  delay(1000);

  mySerial.println("AT"); //Once the handshake test is successful, i t will back to OK
  updateSerial();
  
  mySerial.println("ATD+ +91xxxxxxxxxx;"); //  
  updateSerial();
  delay(60000); // wait for 20 seconds...
  mySerial.println("ATH"); //hang up
  updateSerial();
  mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
  updateSerial();
  
  mySerial.println("AT+CMGS=\"+91xxxxxxxxxx\"");//change ZZ with country code and xxxxxxxxxxx with phone number to sms
  updateSerial();
  mySerial.print("Last Minute Engineers | lastminuteengineers.com"); //text content
  updateSerial();
  mySerial.write(26);
}

void loop()
{
}

void updateSerial()
{
  delay(500);
  while (Serial.available()) 
  {
    mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  while(mySerial.available()) 
  {
    Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
  }
}


I took reference from this sitehttps://lastminuteengineers.com/sim800l-gsm-module-arduino-tutorial/
Any help would be appreciated.Thank you.

1 Like

What happens when you try to send commands manually via the serial monitor... with a simple sketch like this.

#include <SoftwareSerial.h>

SoftwareSerial myserial(2, 3);

void setup()
{
  myserial.begin(9600); 
  Serial.begin(9600);
  delay(500);
}

void loop()
{
  while (Serial.available())
  {
    myserial.write(Serial.read());
  }


  while (myserial.available())
  {
    Serial.write(myserial.read());
  }
}

To answer an incoming call you need to send command

AT+ATA

When sending a text message you need to pause after sending the initial command...

AT+CMGS="+91xxxxxxxxxx"

this allows the modem to response with a prompt ">" so that you can enter the message text.

Thanks For Reply.
It works , but like a blind way :rofl: ,cause I cant see the responses.And after adding this line before sending sms "AT+CNMI=2,2,0,0,0" and giving delay about 1000ms ,msg sent successfully.Now what to do to see the AT command responses?

You need to be continually reading the serial buffer coming in from the modem. This code needs to be running all the time... you should remove the delay(500) from the updateSerial routine.

can u post a working code?I don't want to send command from Serial,i will send that from my code,i just want only to see responses.

Post your latest code...

#include <SoftwareSerial.h>

//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial( 2,3); //SIM800L Tx & Rx is connected to Arduino #2 & #3

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);
  
  //Begin serial communication with Arduino and SIM800L
  mySerial.begin(9600);

  Serial.println("Initializing..."); 
  delay(1000);

  mySerial.println("AT"); //Once the handshake test is successful, i t will back to OK
  updateSerial();
  mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
  updateSerial();
  mySerial.println("AT+CNMI=2,2,0,0,0"); // Configuring TEXT mode
  updateSerial();
mySerial.println("AT+CMGS=\"+ZZxxxxxxxxxx\"");//change ZZ with country code and xxxxxxxxxxx with phone number to sms
  updateSerial();
  delay(1000);
  mySerial.print("Hello There"); //text content
  updateSerial();
  mySerial.write(26);
void loop()
{
}
void updateSerial()
{
  delay(500);
  while (Serial.available()) 
  {
    mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  while(mySerial.available()) 
  {
    Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
  }
}


Try this...

#include <SoftwareSerial.h>

//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(2, 3); //SIM800L Tx & Rx is connected to Arduino #2 & #3

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);

  //Begin serial communication with Arduino and SIM800L
  mySerial.begin(9600);
  delay(500);
  
  Serial.println("Initializing...");

  mySerial.println("AT"); //Once the handshake test is successful, i t will back to OK
  delay(50);
  updateSerial();

  mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
  delay(50);
  updateSerial();

  mySerial.println("AT+CNMI=2,2,0,0,0"); // Configuring TEXT mode
  delay(50);
  updateSerial();

  mySerial.println("AT+CMGS=\"+zzxxxxxxxxx\"");//change ZZ with country code and xxxxxxxxxxx with phone number to sms
  delay(50);
  updateSerial();

  mySerial.print("Hello There"); //text content
  mySerial.write(26);
  delay(50);
  updateSerial();


}


void loop()
{
  updateSerial();
}

void updateSerial()
{
  while (Serial.available())
  {
    mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  
  while (mySerial.available())
  {
    Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
  }
}

Once this code runs you can still query (send AT commands to) the modem from the serial monitor.

Nothing printed on output. Now I can't send SMS also. I tried with my previous code also.
Only i can make call using

 mySerial.println("ATD+ +zzxxxxxxxxxxx;"); //  change ZZ with country code and xxxxxxxxxxx with phone number to dial
updateSerial();
delay(10000); // wait for 20 seconds...
mySerial.println("ATH"); //hang up
updateSerial();

How to fix the problem.Only calling works and that is also like blindly cause i don't get any response.
Update
After 2/3,times presing arduino reset button some times messge sent.What is the problem.This doesn't happen for call then why this happened with sms.I think this can be fixed if i get the response..
Is this baud rate related problem?

I'm having the same issue. Except that My code is empty. I seem to be stuck in the ">" prompt even after entering the text message until I reconnect the GSM hat.

Are you trying to send the message from the Serial Monitor?

The text message needs to be terminated with Control-Z (Char 26). You can't send this character from the monitor, so easiest is to just use another character (like '*')... then replace the * with Char 26 before sending to the modem.

while (Serial.available()) 
  {
    char c = Serial.read();
    if (c == '*')
      mySerial.write(26);  // Send Control Z
    else
      mySerial.write(c); //Forward what Serial received to Software Serial Port

  }

I am, will let you know if the code snippet works!

I'm not using an Arduino Uno. It's just GSM module to PC, connected by the USB cable. The setup is in my posts.

This is an Arduino forum?

What posts would those be?

Post 1 and Post 2. My first post on the forum is irrelevant.

Do you think anyone reading this post will know about your other posts?

Don't hi-jack someone else's post.

I will update your "post 2".

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.