I know it is somehow weird problem, but I don't know what to do.
I am using SIM800L GSM module with ESP8266 nodemsu v3 and they are connected via UART serial communication.
I am using this code to send an SMS
SIM800L GSM Module Network Connection AT Commands on Arduino
Arduino Code – Sending an SMS
Let’s move on to the interesting stuff. Let’s program our Arduino to send an SMS.
Before trying out the sketch, you’ll need to enter the phone number to which you want to send an SMS. Look for the highlighted string ZZxxxxxxxxxx and replace ZZ with the county code and xxxxxxxxxx with the 10 digit phone number.
#include <SoftwareSerial.h>
//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(D7, D8); //SIM800L Tx & Rx is connected to Arduino #D7 & #D8
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, it will back to OK
updateSerial();
mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CMGS=\"+ZZxxxxxxxxxx\"");//change ZZ with country code and xxxxxxxxxxx with phone number to sms
updateSerial();
mySerial.print(" Hello world "); //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
}
}
and it was working perfectly unless it suddenly stopped working and now it receives the CTRL+Z character as a message body, it keeps waiting for message body.
I tried also the same AT commands through the serial monitor and it gives the same result (keeps waiting for message body to be entered) and does not send it.