SIM800L issue

Hi everyone
I want make GSM controlled Relay.
I using serial software on arduino nano and simcom sim800L GSm module.
Arduino nano and GSm module not communicate first powered. When reset Arduino nano then can communicate.

How can I fix this problem?

My code are:

#include <SoftwareSerial.h>
SoftwareSerial dtmfPort(2,3); //my software serial name dtmfPort and connected GSM Rx- Arduino3, GSM tx-Arduino2
char dtmfdata;
bool testbit = LOW;

void setup() {
pinMode(12, OUTPUT); // Relay output pin
digitalWrite(12, HIGH); //my relay low level trigged
Serial.begin(9600); // Start serial for PC
dtmfPort.begin(9600); // Start serial For GSm module
delay (30000); // wait for GSm Module startup and registering GSM network
dtmfPort.print("AT"); //Test GSm Module
delay(100); //delay for response
char dtmfdata = dtmfPort.read(); //GSM module response transfering dtmfdata register
Serial.write(dtmfdata); //dtmf data sending to PC
}

void loop() {
if (dtmfPort.available()){
dtmfdata = dtmfPort.read();
Serial.write(dtmfdata);
Serial.println();
}
if(dtmfdata=='1'){
digitalWrite(12, LOW);
testbit = HIGH;

}
if(dtmfdata=='2'){
digitalWrite(12, HIGH);
testbit = LOW;
}
if (testbit==LOW & dtmfdata=='2'){
delay(5000);
}
}

You have asked a new question in a very old Thread. I have suggested to the Moderator to move it to its own Thread.

Does the GSM module send any characters to tell you when it is first ready? That is, does it send characters before you ask for any? If so, you are not reading them.

...R

GSm not sent to data.
Because GSm module late opening.
Other thing some time system working some time not working after reset arduino.

frtkose DO NOT HIJACK THREADS !

Topic split.

Bob.

frtkose:
GSm not sent to data.
Because GSm module late opening.

I guess I did not express my question sufficiently clearly in Reply #1.

What I want to know is whether the GSM module is designed to send a message when it is ready - what does its datasheet or user manual say?

...R