Hello blh64,
The strings have almost always been in the F() function and therefore in the PROGMEM. In the meantime I have simply commented out all Serial.print commands. Since then the program runs stable. For programming work I can activate the serial output at any time again.
In principle you could split the C-String into several small parts, but I use a standardized function for the communication with the Sim800L, which waits for the Sim800L to confirm the command, e.g. with 'OK' etc.
My problem is rather that I can not yet transfer the data encrypted with SSL. As soon as I change the URL index on https:// the transmission does not work anymore. Also the AT+HTTPSSL did not help.
Maybe I should really make a POST instead of a GET. That could possibly help...
//SIM800L BEFEHLE
byte Sim800WD1 = 1;
byte Sim800WD5 = 5;
char batterie_proz[4] = "111"; //Batterie Füllstand
char batterie_volt[5] = "1111"; //Batterie Spannung
char Sim800Free[1] = "";
char Sim800CBCa[6] = "CBC: ";
char Sim800AT[3] = "AT";
char Sim800OK[3] = "OK";
char Sim800READY[6] = "READY";
char Sim800ATCPINf[9] = "AT+CPIN?"; //Frage SIM Karte ab
char Sim800ATCGATT0[11] = "AT+CGATT=0";
char Sim800ATCGATT1[11] = "AT+CGATT=1";
char Sim800CGATTf[10] = "AT+CGATT?";
char Sim800CGATTa1[10] = "+CGATT: 1";
char Sim800ATCSCLK0[11] = "AT+CSCLK=0"; //GSM-Modul aufwecken
char Sim800ATCSCLK2[11] = "AT+CSCLK=2"; //GSM-Modul schlafen legen
char Sim800Contype[34] = "AT+SAPBR=3,1,\"Contype\",\"GPRS\"";
char Sim800APN[42] = "AT+SAPBR=3,1,\"APN\",\"internet.eplus.de\"";
char Sim800USER[32] = "AT+SAPBR=3,1,\"USER\",\"eplus\"";
char Sim800PWD[30] = "AT+SAPBR=3,1,\"PWD\",\"gprs\"";
char Sim800ATHTTPREAD[12] = "AT+HTTPREAD";
char Sim800ATHTTPINIT[12] = "AT+HTTPINIT";
char Sim800ATHTTPTERM[12] = "AT+HTTPTERM";
char Sim800ATHTTPSSL1[13] = "AT+HTTPSSL=1";
char Sim800ATHTTPACTION0[16] = "AT+HTTPACTION=0";
char Sim800ATSAPBR01[13] = "AT+SAPBR=0,1";
char Sim800ATSAPBR11[13] = "AT+SAPBR=1,1";
char Sim800ATSAPBR21[13] = "AT+SAPBR=2,1";
void loop() {
[...]
WaitForSimAnswer(Sim800ATCSCLK0, Sim800OK, Sim800Free, Sim800WD5); //Wake UP
WaitForSimAnswer(Sim800CGATTf, Sim800CGATTa1,Sim800ATCGATT1, Sim800WD5); //Check
WaitForSimAnswer(Sim800Contype, Sim800OK, Sim800Free, Sim800WD5); //LogIn
WaitForSimAnswer(Sim800APN, Sim800OK, Sim800Free, Sim800WD5);
WaitForSimAnswer(Sim800USER, Sim800OK, Sim800Free, Sim800WD5);
WaitForSimAnswer(Sim800PWD, Sim800OK, Sim800Free, Sim800WD5);
WaitForSimAnswer(Sim800ATSAPBR11, Sim800OK, Sim800Free, Sim800WD5);
WaitForSimAnswer(Sim800ATSAPBR21, Sim800OK, Sim800Free, Sim800WD5);
WaitForSimAnswer(Sim800ATHTTPINIT, Sim800OK, Sim800Free, Sim800WD5); //HTTP Initial
WaitForSimAnswer(Datensatz, Sim800OK, Sim800Free, Sim800WD5); //Send URL to Sim800L
WaitForSimAnswer(Sim800ATHTTPSSL1, Sim800OK, Sim800Free, Sim800WD5); //Acitvate SSL
WaitForSimAnswer(Sim800ATHTTPACTION0, Sim800OK, Sim800Free, Sim800WD1); //Do Get-Request
WaitForSimAnswer(Sim800ATHTTPREAD, Sim800OK, Sim800Free, Sim800WD5); //HTTP Read
WaitForSimAnswer(Sim800ATHTTPTERM, Sim800OK, Sim800Free, Sim800WD5); //End HTTP
WaitForSimAnswer(Sim800ATSAPBR01, Sim800OK, Sim800ATCGATT0, Sim800WD5); //END GPRS
WaitForSimAnswer(Sim800ATCSCLK2, Sim800OK, Sim800Free, Sim800WD5); //Sleep Mode Sim800L
[...]
}
void WaitForSimAnswer(char* Frage, char* Antwort, char* Loesungsbefehl, byte &CounterEnd)
{
byte Counter = 0;
flushSerial();
while(1){
sim.println(Frage); //Stelle Frage an das GSM-Modul
delay(500);
if (sim.find(Antwort)) //Finde Antwort
{
flushSerial();
break;
}
else
{
Counter++;
if (Counter >= CounterEnd)
{
flushSerial();
break;
}
if(Loesungsbefehl != ""){sim.print(Loesungsbefehl);}
flushSerial();
delay(500);
}
}
}
Greetings
Timo