Still problem with the AI Thinker A7 GPRS/GPS module

Hi everyone,

unfortunately I still have probles with installing my A7 module to my arduino MEGA 2560 R3.

Does anybody have a working sketch and hardwareplan?
I tried different sketches from this forum bu none of them worked.

greetings from cologne

Andreas

Do you have prior posts on this subject? If so, it would be good if you link to those posts so members know what you have already tried.

Hi,

the module is connected:

A7 Arduino

GND GND
5V 5V
RX TX Port 9
TX RX Port 8
GPSTX RX Port 0

The Code is as follows: (I have to mention, that I tried most every PIN-combination incl. code)

#define gpsPort Serial // GPS_TXD to pin 0

#include <AltSoftSerial.h>
AltSoftSerial A7board;  // U_TXD to pin 8 and U_RXD to pin 9

void setup()
{
  Serial.begin(9600 );

  gpsPort.begin( 9600 ); // not needed if gpsPort *is* Serial

  A7board.begin( 9600 ); // probably won't be reliable at this speed

  Serial.println( F("Send AT command") ); 
  A7board.println( F("AT") );
  print_result_for( 25000 );
 
  Serial.println( F("AT+GPS turn on") );
  A7board.println( F("AT+GPS=1") );
  print_result_for( 10000 );

  Serial.println("AT+GPSRD turn on"); 
  A7board.println("AT+GPSRD=1"); 
  print_result_for( 10000 );

  //  ... other commands you want to try?
}

void print_result_for( unsigned long waitMS )
{

  Serial.print( F("GPS info: ") );  // F macro saves RAM!

  unsigned long startMS = millis();
  while (millis() - startMS < waitMS) {
    if ( gpsPort.available() ) {
      Serial.write( gpsPort.read() );
    }
  }
  Serial.println(); 

  Serial.print( F("A7 info: ") );

  while ( A7board.available() ) {
    Serial.write( A7board.read() );
  }
  Serial.println(); 
}


void loop()
{
  print_result_for( 5000 );
}

Andreas

If you have a Mega, why are you using soft serial instead of one of the 3 extra hardware serial ports? What is the problem? It doesn't work is not an adequate description of the issue.

I think the A7 module only runs at 115200. It will have to be connected to one of the extra hardware serial ports, Serial1 (pins 18 & 19), Serial2 (pins 16 & 17) or Serial3 (pins 14 & 15).

Hi,

I tried to install the module un serial1 with the following connections:

A7 Mega2560
GPS-TX RX1
RX TX1
GND GND
5V 5V

and this code:

void print_result()
{
  Serial.print("A7 board info: ");
  while( Serial1.available() != 0)
    Serial.write( Serial1.read());
  Serial.println();  
}
//--------------------------------------------------------------------

void setup() {
  Serial.begin(115200);
  Serial1.begin(115200);
  delay(200); 

  Serial.println("Send AT command");  
  Serial1.println("AT");
  delay(5000);
  print_result();
  
  Serial.println("AT+GPS turn on");  
  Serial1.println("AT+GPS=1");  
  delay(10000);
  print_result();
  
  Serial.println("AT+GPSRD turn on");  
  Serial1.println("AT+GPSRD=1");  
  delay(10000);
  print_result();


  
}
//--------------------------------------------------------------------

void loop() {
  print_result();
  delay(2000);
}
//--------------------------------------------------------------------

and get no answer from the module :frowning:

What do I do wrong?

Andreas

What do I do wrong?

Try this:

A7 Mega2560
TX RX1
RX TX1
GPS-TX RX2
GPS-RX TX2
GND GND
5V 5V

I'm pretty sure the A7 TX/RX runs at 115200, so do this in setup:

    Serial1.begin( 115200 );

You will send AT commands to Serial1, and print_results will read the responses from Serial1. Debug info should still be sent to Serial (for display on the Serial Monitor window).

I don't know what speed the GPS_TX pin runs at. Try several values (9600, 38400, 57600, 115200) in setup like this:

    Serial2.begin( ? );

I don't know if NMEA data will just start arriving on Serial2, or if you have to send an AT command (on Serial1). NeoGPS would parse data from Serial2.

Hi,

I tried almost everything - but now I found out, that the A7 is using 3.3 V level and my mega2560 5V.

Does it also work with this different Voltage or should I use a level-shifter?

Andreas

Hi,

I am so close to reach my goal!
After a lot of testing and surfing the internet, it finally works... let's say 75%

Now i am able to call my phone an to send an sms.
Then i tried to read the GPS-signal and this is what comes out of the A7

$GPVTG,,T,,M,,N,,K,N2C
$GPGGA,183455.000,,,,,0,00,
$GPGSV,1,1,01,20,00,000,23
4B
$GPRMC,183455.000,V,,,,,,,290318
18,,,N41
$GPVTG,,T,,M,,N,,K,N
2C
$GPGGA,183457.000,,,,,0,00,
18,,,N40
$GPVTG,,T,,M,,N,,K,N
2C
$GPGGA,183458.000,,,,,0,00,
18,,,N4F
$GPVTG,,T,,M,,N,,K,N
2C
$GPGGA,183459.000,,,,,0,00,3
18,,,N4E
$GPVTG,,T,,M,,N,,K,N
2C
$GPGGA,183500.000,,,,,0,00,

If I see it right, no geographical data is in this code (should be in $GPGGA).
What could be the problem? I've bought an additional GPS antenna but it doesn't hav any effect on the result.

Andreas

Connections and/or picture?

Code?

Hi,

the connection is:

A7 Arduino
GPS-TX RX2
TX RX1
RX TX1

all connections have a 3.3V converter. make a phonecall or send an sms is no problem.

void print_result()
{
  Serial.print("");
  while( Serial2.available() != 0)
    Serial.write( Serial2.read());
  Serial.println();  
}
//--------------------------------------------------------------------

void setup() {
  Serial.begin(115200);
  Serial1.begin(115200);
  Serial2.begin(9600);
  delay(200); 

  Serial.println("Send AT command");  
  Serial1.println("AT");
  delay(5000);
  print_result();
  
  Serial.println("AT+GPS turn on");  
  Serial1.println("AT+GPS=1");  
  delay(10000);
  print_result();
  
  Serial.println("AT+GPSRD turn on");  
  Serial1.println("AT+GPSRD=1");  
  delay(10000);
  print_result();


  
}
//--------------------------------------------------------------------

void loop() {
  print_result();
  delay(1000);
}
//--------------------------------------------------------------------

What could be the problem?

Are you outside, with a clear view of the sky?

How is it powered?

I was some kind of outside (outside of an open window)
What irritates me is, that I receive the time becausr as far as I remebmer this data is part of the gps signal.

The GPS likely keeps track of time once it has got a signal so it doesn't mean it's getting it live.

Look at the GSV sentence. It can only see one satellite and the position and signal strength for it are bad. It looks like you need to go fully outside.

horstsergio:
What irritates me is, that I receive the time becausr as far as I remebmer this data is part of the gps signal.

GPS sentences just showing the time, and no location details, is normal behaviour under weak signal conditions.

Dont mess about, take the GPS outside.