1

The code that I use:

#include <SoftwareSerial.h>

//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(16, 17); 

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+CSQ"); //Signal quality test, value range is 0-31 , 31 is the best
  updateSerial();
  mySerial.println("AT+CCID"); //Read SIM information to confirm whether the SIM is plugged
  updateSerial();
  mySerial.println("AT+CREG?"); //Check whether it has registered in the network
  updateSerial();
}

void loop()
{
  updateSerial();
}

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
  }
}

but if I run it, the GSM doesn't seem to respond or it show me different characters as its output "???".

Connection:

SIM800L Nodemcu ESP-32s
RX GIOP17
TX GIOP16

enter image description here

enter image description here

the expected output:

enter image description here

the output I have: enter image description here

3
  • 1
    how do you know that the GSM module is not responding? ... please edit your post with a description of what you expected to happen and what you observed Commented Nov 6, 2021 at 3:58
  • 2
    why don't you use hardware serial, instead of software serial? Commented Nov 6, 2021 at 4:05
  • The by default baud rate of sim800 is 115200 try using this baud rate if it works if it works then try changing the baudrate using AT command AT+IPR=<baudrate> and then use AT&W to store the baud rate Commented Nov 20, 2021 at 12:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.