A9G GMS/GPS and Arduino Mega

Hello!

I hope you can help me because I'm already desperate. After several failed attempts with the SIM800L, I have changed the GSM/GPS module for the A9G and I have an arduino Mega. The problem I have is that I try to communicate with the A9G through the arduino but it is impossible... Through a TTL I have succeeded, but not with Arduino. I have connected the Tx and Rx pins of the A9G module to the D3 and D4 of my arduino Mega. I feed the A9G with a 3.7V and 820mAh battery through the VBat connector of the module and I have connected the grounds of the module and Arduino. I have used the following program:

#include <SoftwareSerial.h>

//Create software serial object to communicate
SoftwareSerial mySerial(3, 4); //

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

  Serial.println("Initializing...");
  delay(10000);

}

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

However, the serial monitor gives me no data. Nothing. I only see "Initializing..." and I don't know what to do anymore. I have to deliver a project next week with GPS and Blynk and I've been fighting with GSM module and GPS for 1 month. I pull my hair out XD

How could I do communication with the A9G?

Thank you very much for any kind of help.

The chances of softwareserial working at 115200 baud are zero, its around 38400 absolute maximum.

But why use softwareserial in the first place ? The Mega has 3 spare proper hardware serial ports.

Thanks for your answer! It's the program I used before when communicating with the SIM800L and an Arduino UNO, but due to the size of the overall project, I just moved to an Arduino Mega. Of great importance?
I have changed the speed from 115200 to 38400 but the result is the same.

I have made the changes in the code:

//#include <SoftwareSerial.h>

//Create software serial object to communicate
//SoftwareSerial mySerial(3, 4); //

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);
  
  //Begin serial communication with Module
  Serial1.begin(38400);

  Serial.println("Initializing...");
  delay(10000);

}

void loop()
{
  updateSerial();
}

void updateSerial()
{
  delay(500);
  while (Serial.available()) 
  {
    Serial1.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  while(Serial1.available()) 
  {
    Serial.write(Serial1.read());//Forward what Software Serial received to Serial Port
  }
}

And I have connected the Tx pin of the A9g to the Rx1 of the Mega and the Rx of the A9g to the Tx of the Mega, but the result is still the same... I put "AT" for the serial monitor, but nothing appears or does anything.

What does the A9G datasheet or user manual say? Post a link to it.

the Rx of the A9g to the Tx of the Mega

Try TX1 instead of TX.

Sorry, it was a typo, yes it is connected to Tx1, the same as to Rx1.

This is the manual that I have, unfortunately, it is in Asian language that I do not understand.

That is a 3.3V device. You must use logic level shifters to safely connect to a 5V Arduino.

If you have not done so, it may already be damaged.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.