GSM Module SIM900A giving error

Hi I am using SIM900A and i get this error in the image below, can someone help me how to fix this? or is there any steps on how to configure a SIM900A? Thanks in advance!

#include <SoftwareSerial.h>

//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(8, 9); //SIM800L Tx & Rx is connected to Arduino #3 & #2

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(115200);
  
  //Begin serial communication with Arduino and SIM800L
  mySerial.begin(115200);

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


and it displays in the monitor the image below. It is nonstop loop. Instead of AT commands

You won't see the AT commands. Those aren't echoed by the device. You are seeing the responses, which is what you should see.

after the AT commands it gets the random errors like IIII,

Why do you consider those as errors?

Software serial is very unlikely to work at anything over 19200, ideally 9600 bps.

Because i have 15 pcs of sim900a. Some of them are working and some are not. I am also using the same code. Some of them dont display like I've posted here.

I tried 9600 and 19200 and it gets a bunch of question mark

You should have mentioned this in the first post. Any other things you didn't mention?

The send and receive rates have to match. Try to communicate directly with the module, from a terminal emulator. Then it will be easy to find the actual rate and match it in code.

It's possible that the different modules were set to different rates...

Also you only tried two out of many rates..

Also when im sending sms using SIM900A, it gets ERROR, but the other SIM900A is working. Same wiring, same code. any idea what might the problem?

See if you can find a way to perform a factory reset on them.

1 Like

also changed in the code, and yep. only 115200 is working

There is an AT command to set the baud rate, and usually another one to make it the default rate.

Anyway, the important thing is to do direct testing, don't depend on your program to operate it. Then the problem could be in your program or the device settings, but you won't know which.

will do, check this one. it gets error and a bunch of random IIII and CPIN
image

That is program testing, the exact opposite of what I recommended. You should be able to do direct testing without changing hardware by loading the serial pass-through sketch. It allows you to type directly to the SIM900. This will help to troubleshoot.

Then you’ll need to change that, or find another processor with a second hardware serial port.

dont have any idea how to direct testing. the module ive mentioned earlier that is working, it's getting error now lols.

I told you how in reply #15.

I think power shortage is the problem, hope this works. Thank you guys for help!

Not going to work at that speed. I've found 38,400 reliable.

You will need to change the baud rate on the modem by sending
AT+IPR=38400

Then change your code to match.