How I can reduce it's time? (Beginner)

I'm using this code for sending SMS through sim800L, sometimes it delivers the text but sometimes it doesn't. Sometimes it delivers in 5mints and sometimes doesn't. kindly tell me how can I reduce the time as well as sending it in the proper way.

CODE:
#include <Sim800l.h>
#include <SoftwareSerial.h> //is necesary for the library!!
Sim800l Sim800l; //to declare the library
char* text;
char* number;
bool error; //to catch the response of sendSms

void setup(){
Serial.begin(9600);
pinMode(A4,OUTPUT);
Serial.println("Program getting started");
digitalWrite(A4,HIGH);
delay(10000);
Sim800l.begin(); // initializate the library.
text="Testing"; //text for the message.
number="+9xxxxxxxxxxx"; //change to a valid number.
Serial.println("Sending data");
error=Sim800l.sendSms(number,text);
//or
Serial.println("sending....wait...Almost done");

Sim800l.sendSms("+9xxxxxxxxxxx","im here");
Serial.println("Data has been sent");

}

void loop(){
//do nothing
}

For informed help, please read and follow the directions in the "How to use this forum" post.

Of course, this

delay(10000);

wastes the considerable power of an Arduino for 10 seconds but probably has nothing to do with your problem.

I didn't get it?

vaj4088:
Of course, this

delay(10000);

wastes the considerable power of an Arduino for 10 seconds but probably has nothing to do with your problem.

vaj4088:
Of course, this

delay(10000);

wastes the considerable power of an Arduino for 10 seconds but probably has nothing to do with your problem.

You're being facetious of course. Did you know that facetious is one of only two words in the English language that uses all five vowels just once and in their proper order? And sometimes 'y'.

DKWatson:
You're being facetious of course.

You're either not serious or you're funny. I had to consult google translate :wink:

DKWatson:
Did you know that facetious is one of only two words in the English language that uses all five vowels just once and in their proper order? And sometimes 'y'.

Nice for a pub quiz 8) Out of curiosity, what is the other word?

abstemious

hello_arduino:
I'm using this code for sending SMS through sim800L, sometimes it delivers the text but sometimes it doesn't. Sometimes it delivers in 5mints and sometimes doesn't. kindly tell me how can I reduce the time as well as sending it in the proper way.

I have no experience with sims.

From a coding perspective.
1)
I suggest that you check the value of the error variable after the call of sendSms(); it should indicate that the transmission was successful or not.
2)
You are aware that because you have placed the code for the sending in setup(), it will work only once and you have to reset your Arduino to send out a second message.

Your problem can also be caused by the service providers. I usually send my wife a sms when I leave work to go home; sometimes she gets the sms soon after that, sometimes she only receives the sms just before I arrive home or sometimes the sms only comes through when I'm already at home (30 minutes later).

DKWatson:
abstemious

Thanks, had to use google translate for that one as well :slight_smile: