I've been trying for a few days now, I've been reading on the internet and I can't find a solution.
please tell me what could be the cause.
messages longer than 30 characters are illegible, letters and special characters replaced.
I checked the same code on SIM800L and it works and long messages arrive.
#define RX_A7670E 4
#define TX_A7670E 5
#include <SoftwareSerial.h>
SoftwareSerial mySerial(RX_A7670E , TX_A7670E); // RX TX
#define RELAY 12
String receive_Sim = "";
String stateRelay= "off";
String nr_Tel = "+45xxxxxxxxx";
void setup() {
pinMode(RELAY, OUTPUT);
Serial.begin(115200);
mySerial.begin(115200);
delay(10000);
while (!mySerial.available()) {
mySerial.println("AT");
delay(1000);
Serial.println("Connecting...");
}
Serial.println("Connected!");
mySerial.println("AT+CMGF=1");
delay(1000);
mySerial.println("AT+CNMI=1,2,0,0,0");
delay(1000);
mySerial.println("AT+CMGL=\"REC UNREAD\"");
delay(500);
}
void On_Off_SMS() {
if (receive_Sim.indexOf(nr_Tel) > -1) {
if (receive_Sim.indexOf("On") > -1) {
digitalWrite(RELAY, HIGH);
stateRelay = " Hello from Arduino. I would like to send long messages on the GSM module. I can't find a solution. Greetings to everyone and have a nice day";
delay(1000);
sendSMS();
delay(200);
receive_Sim = "";
}
if (receive_Sim.indexOf(nr_Tel) > -1) {
if (receive_Dane_Sim.indexOf("Off") > -1) {
digitalWrite(RELAY, LOW);
stateRelay = "OFF";
delay(1000);
sendSMS();
delay(200);
receive_Sim = "";
}
void loop() {
if (mySerial.available()) {
delay(100);
// Serial Buffer
while (mySerial.available()) {
receive_Sim = mySerial.readString();
}
delay(10);
Serial.println(receive_Sim);
On_Off_SMS();
}
}
void sendSMS() {
Serial.println("Sending SMS...");
mySerial.print("AT+CMGF=1\r");
delay(100);
mySerial.print("AT+CMGS=\"+45xxxxxxxx\"\r");
delay(500);
mySerial.print("Relay " + stateRelay);
delay(500);
mySerial.print((char)26);// (required according to the datasheet)
delay(500);
mySerial.println();
Serial.println("text");
delay(500);
}