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