SIM800L GSM module response isn't completed

Hello everyone

i am using sim800l gsm module with nodemcu esp8266 and comunicating with it using AT+ commands, the module is working correctly but i am trying to use the command AT+CLCC to get all the current calls's state but it response with only the first call information and a part of the second call.

this is the response while there is two active calls

15:37:19.156 -> AT+CLCC
15:37:19.156 -> +CLCC: 1,0,1,0,0,"+0123456789",145,"name"
15:37:19.156 -> 
15:37:19.156 -> +CLCC: 2,

i think it is the Serial buffer's problem because the size of the serial buffer is 64 byte and the response is more than that but i don't know how to handle that

i hope someone can help

Best regards.

Please post your code.

what is the baudrate of the ESP8266 Serial monitor and the SIM880?
make sure you have installed EspSoftwareSerial

This is the code i am using



#include <SoftwareSerial.h>
#include <cstring>

#include <Arduino.h>

#define simTX D3
#define simRX D4

SoftwareSerial sim800l(simRX, simTX);  //RX, TX

void setup() {

  Serial.begin(115200);  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)

  sim800l.begin(115200);  //Begin serial communication with Arduino and SIM800L

}

void loop() {

  updateSerial();

}


//Start
// this method takes input from the serial monitor the pass it to sim800l via serial communication
void updateSerial() {
  delay(500);
  while (Serial.available()) {
    sim800l.write(Serial.read());  //Forward what Serial received to Software Serial Port
  }
  while (sim800l.available()) {
    Serial.write(sim800l.read());  //Forward what Software Serial received to Serial Port
  }
}
//End

The baudrate of the ESP's Serial monitor and the SIM800L are 115200 and i am using <SoftwareSerial.h> library and it is working perfectly in all the commands except the AT+CLCC its response is not completed

try removing the delay - using software serial this could loose you a lot of data
and could be the cause of your problem

i tried to remove the delay but it made a problem in the response

Then fix that problem. It would be helpful if you told us what the problem in the response is, exactly.

this is a program I used to communicate with a UNO using a SIM800L

// SIM800l AltSoftSerial test 

#include <AltSoftSerial.h>

// Mega SIM800l  test
//SIM800L 5V  POWER to Mega 5V
//SIM800L GND POWER to Mega GND
//SIM800L TXD to Mega RX pin 48
//SIM800L RXD to Mega TX pin 46
//SIM800L VDD to Mega 5V

//SIM800L UART TTL GND and RST not connected

//SIM800L TXD to UNO RX pin 8
//SIM800L RXD to UNO TX pin 9

// taking the RST pin to GND for a couple of seconds which will reset the device

//  RS232 shield 
//   RS232 TXD to UNO pin 9
//  =[===RS232 RXD to UNO pin 8
AltSoftSerial simSerial;

void setup() {
  Serial.begin(115200);
  Serial.println("AltSoftSerial test");
  //Begin serial communication with Arduino and SIM800L
  simSerial.begin(9600);
  Serial.println("SIM module intialized");
}

void loop() {
  if (Serial.available()) {
    char command = Serial.read();
    //Serial.println(command);
    simSerial.print(command);
  }
  while (simSerial.available()) {
    char reponse = simSerial.read();
    Serial.print(reponse);
  }
}

running on a UNO the Serial Monitor displays in response to commands

AT
OK
AT+CGMI
SIMCOM_Ltd
OK
AT+CGMM
SIMCOM_SIM800L

Can you please try to make two calls to the module then use the command AT+CLCC to get the two calls status?

Yes it is fixed with the delay. If i remove the delay the response is right i receive a square characteres instead of the data.

Also this delay is recommended from the sim800l's manufacturer

Reference please?

Sorry not manufacturer, but all the references that i found like what i mentioned in the last reply.
and that is recommended to wait untill the sim800 sends all the data

this is the response of AT

23:03:16.355 -> β–‘AT

23:03:16.355 -> OK

Doesn't it respond with "OK" when it's done?

no AT+CLCC doesn't respond with ok, this is the response of it

22:54:55.552 -> AT+CLCC  
22:54:55.552 -> +CLCC: 1,0,0,0,1,"+0123456789",145,"name" 
22:54:55.552 ->  
22:54:55.552 -> +CLCC:

while knowing that there is two active calls

...but it does respond, right? Shouldn't you wait for (read) the response? Not just assume that it has responded by waiting 500ms?

sorry i didn't got you, can you please explain what you mean

If you need to know when the response to a command is complete, why not read the message coming back from the device that tells you so?

When it responds, it is telling you, "I'm finished".

yes of course that is awesome, but can you please tell me how to do that?