GPS vs Ai Thinker A7 module

I have recently started using the Elecrow A7 shield, and related to this post re. GPS, I found that the Elecrow shield does not connect the A7 module's GPS_TXD pin (pin 37) to anything. See here for Eagle files.

It may be possible that the GPS_TXD data is somehow available through the UART port but given the poor documentation and lack of support for the A7 I may have missed it. I have a query pending with Elecrow and will post any responses here.

Edit: ok so the trick is in slink21's post #16 - should have tried that before posting!
This sequence enables GPS data out of the UART port at 115200 baud.
AT+GPS=1
AT+GPSRD=1

FrankCA:
This sequence enables GPS data out of the UART port at 115200 baud.
AT+GPS=1
AT+GPSRD=1

yeap, this will work.

If anyone succeeded to open the AGPS, please help.

Hi,

I have used AT+GPSRD=1 and it freezes the device

If you type AT+GPSRD=? the possible values are from 0 to 3600 it looks like that are the seconds to send the GPS read automatically

Any idea ?

AT+AGPS=1 same error like other people said

Any idea ?

Hi @PieterE

I've just bought the same module as you.

Would you mind sharing your cabling and code for both SMS and GPS?

There was no guide coming up with the A7 module :frowning:

Thank you

I made the AGPS work
this is the code follow the AT commands and replace the APN with your own

A7command("AT+GPSRD=0","OK","yy",GF,1, NULL);
A7command("AT+CGATT=1", "OK", "yy", 20000, 3, NULL);
A7command("AT+CGDCONT=1,"IP","" + APN + """, "OK", "yy", 20000, 2, NULL); //bring up wireless connection with APN
A7command("AT+CGACT=1,1", "OK", "yy", 20000, 2, NULL);
A7command("AT+AGPS=1", "OK", "yy", 20000, 3, NULL);

Could you please share the details about level shifter and suggest some one for arduino UNO?

@dev

your library sounds elegant but I struggle using it as the GPRS+GPS A7 module has multiple TX & RX pins but the one we are interested in are:

U_TXD --> used for AT commands
U_RXD --> used for AT commands

GPS_TXD --> used to get GPS infos

Where do I connect GPS_TXD to and how do I get the information coming from this pin? There is a lot of answer in this thread but none answer this question.

I've got this model : WHDTS A7 GSM+GPRS+GPS

and I could only get the SMS feature to work, the example provided by the seller is only for the Arduino Mega and it does not work on the UNO.

Where do I connect GPS_TXD to and how do I get the information coming from this pin?

You must connect it to an Arduino pin that has a hardware serial port or a software serial port.

For example, you might connect GPS_TXD to Serial pin 0 or the Serial1 receive pin. This depends on which Arduino you are using.

Here is a description of how to choose a serial port, ordered from best to worst. SoftwareSerial is the worst.

Then you pass that serial port variable to the gps.available method:

    if (gps.available( gpsPort )) {
        fix = gps.read();

This NeoGPS method parses GPS data from that port and returns true when a complete fix structure is ready. That structure contains all GPS fields received during that update interval (usually one second).

Hi all, i am newbies on arduino and i want make some tool's for my thesis, hope somebody can help me to solved my problem, and here the feature hope i can to created :

  • when i send sms to number on module a7 example : "GIVE ME POSITION"

and then the a7 module can send current or last position to my number with a link that can be opened by google map or other map.

  • when i send sms to number on module a7 example : "TRUN OFF THE LIGHT"

and then relay will trun off the light or lamp.

here my tools :

  • Arduino Uno
  • AI Thinker A7 quad band GPRS GSM SMS GPS MODULE 5V SERIAL TTL
  • relay 2 channel
    and some other stuff like, breadboard cable jumper male,female.

and here the config :

Ai A7 ------ Arduino Uno
U_TXD ==> PIN 10
U_RXD ==> PIN 11
GND ==> GND

power arduino uno use with usb cable
power ai a7 with external power (adaptor 9v) and here is my a7-module

i've been looking couple days for module a7 but i stil have not found how to use this module
i was try some example code from other forum but still not work and i try to follow the code from this forum on thread #10 about how to use gps with a7 module.

and these last code i try but gps data still not showing, i follow these code from this thread #10
i am really sorry if there any mistake or wrong setting to make this tools, hopefully somebody can help me out and thank you in advance for your help.

#include <NMEAGPS.h>

//#define A7board Serial  // Best would be to connect to the Serial pins 0 & 1
//      or
//#include <AltSoftSerial.h>
//AltSoftSerial A7board; //Next best, but you must use pins 8 & 9!  This is very efficient.
//      or

#include <NeoSWSerial.h>
NeoSWSerial A7board( 10, 11 ); // 2nd best on whatever two pins you want.  Almost as efficient.
// DO NOT USE SoftwareSerial!

NMEAGPS gps;
gps_fix fix;

enum state_t { WAITING, READING_GPS, GPS_ON_WAIT, GPS_READING, GPS_READING_WAIT, GPS_OFF_WAIT, SENDING_SMS }; // other states?
state_t state = WAITING;
uint32_t stateTime;
const uint32_t CHECK_LOCATION_TIME = 5000; // ms

void echoA7chars()
{
  while (A7board.available())
    Serial.write( A7board.read() ); // just echo what we are receiving
}

void ignoreA7chars()
{
  while (A7board.available())
    A7board.read(); // ignore what we are receiving
}

void setup()
{
  Serial.begin( 115200 );
  A7board.begin( 115200 );
}

void loop()
{
  switch (state) {

    case WAITING:
      echoA7chars();

      if (millis() - stateTime >= CHECK_LOCATION_TIME) {

        // Turn GPS data on
        A7board.println( F("AT+GPS=1") );

        stateTime = millis();
        state     = GPS_ON_WAIT;
      }
      break;

    case GPS_ON_WAIT:
      echoA7chars();

      // Wait for the GPS to turn on and acquire a fix
      if (millis() - stateTime >= 5000) { // 5 seconds

        //  Request GPS data
        A7board.println( F("AT+GPSRD=1") );
        Serial.print( F("Waiting for GPS fix...") );

        stateTime = millis();
        state     = GPS_READING;
      }
      break;

    case GPS_READING:
      while (gps.available( A7board )) { // parse the NMEA data
        fix = gps.read(); // this structure now contains all the GPS fields

        if (fix.valid.location) {
          Serial.println();

          // Now that we have a fix, turn GPS mode off
          A7board.println(  F("AT+GPSRD=0") );

          stateTime = millis();
          state     = GPS_READING_WAIT;
        }
      }

      if (millis() - stateTime > 1000) {
        Serial.print( '.' ); // if still waiting for fix, print a dot.
        Serial.print('\n');
        stateTime = millis();
      }
      break;

    case GPS_READING_WAIT:
      ignoreA7chars();

      // Wait for the GPS data to stop
      if (millis() - stateTime >= 1000) {

        // Turn GPS power off
        A7board.println(  F("AT+GPS=0") );

        stateTime = millis();
        state     = GPS_OFF_WAIT;
      }
      break;


    case GPS_OFF_WAIT:
      echoA7chars();

      // Wait for the GPS to power off
      if (millis() - stateTime >= 1000) {

        // Show the location we will send via SMS
        Serial.print( F("loc: ") );
        Serial.print( fix.latitude(), 6 ); // use the latitude field of the fix structure
        Serial.print( F(", ") );
        Serial.println( fix.longitude(), 6 ); // use the longitude field of the fix structure

        // Send SMS with location values ?
        //A7board.print( SMS commands? );
        //A7board.print( F("lat=") );
        //A7board.print( fix.latitude(), 6 ); // use the latitude field of the fix structure
        //  ...

        stateTime = millis();
        state     = SENDING_SMS;
      }
      break;
      
    case SENDING_SMS:
      echoA7chars();

      if (millis() - stateTime >= 2000) {
        stateTime = millis();
        state     = WAITING; // start over
      }
      break;

    
  }
}

The code from that other thread assumes that you are not connecting the GPS_TXD line.

I would suggest connecting the GPS_TXD line to an Arduino receive pin, because you can get GPS information even when the A7 is busy doing something else, and you don't have to send special commands to make the A7 "forward" the GPS information to the U_TXD pin.

Did you try anything I suggested in reply #28?

-dev:
The code from that other thread assumes that you are not connecting the GPS_TXD line.

I would suggest connecting the GPS_TXD line to an Arduino receive pin, because you can get GPS information even when the A7 is busy doing something else, and you don't have to send special commands to make the A7 "forward" the GPS information to the U_TXD pin.

Did you try anything I suggested in reply #28?

hi sir -dev

i've try what you said on reply #28 but the data gps still not showing.

on serial monitoring just show message like this :

AT+GPS=1
AT+GPSRD=1
Waiting for GPS fix...............................................................................................

and here my config pin

A7 ===== Uno

GND======> GND
GPS_TDX===> PIN 0
U_RXD ====> PIN 8
U_TXD ====> PIN 9

and for the code i still use this thread on reply #10

and i use :

#include <AltSoftSerial.h>
AltSoftSerial A7board;

is it there something wrong sir?
because i still not get gps data

Unfortunately, I see that GPS_TXD may not provide NMEA data (see reply #20).

If you tried this:

#include <AltSoftSerial.h>
AltSoftSerial A7board;

#define gpsPort Serial // just an alias so it is easier to read below

void loop()
{
  switch (state) {

      ...

    case GPS_READING:
      while (gps.available( gpsPort )) { // parse the NMEA data from pin 0
        fix = gps.read(); // this structure now contains all the GPS fields

... and did not get any GPS data, then GPS_TXD does not work.

You may have to try the command sequence in reply #25.

You could try the NeoGPS example NMEA.ino. It expects to receive GPS data on Arduino pin 8, if you can connect it to the GPS_TXD pin. If you don't want to move wires, you must edit GPSport.h to use Serial (see Installation instructions).

Or try a simple echo test:

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

void loop()
{
  if (Serial.available()) // any GPS characters?
    Serial.write( Serial.read() ); // echo to Serial Monitor window
}

If you see NMEA sentences, like $GPRMC or $GPGGA, then GPS_TXD does work.

Well... there is a lot of things going wrong according to my experiments of today.

I have the exact same module as charlilio.

1 - The provided antenna is super weak, there is no way you could lock a signal indoors. I had to go outdoors to acquire a signal and finally see it working. Even outdoors, it take ages to acquire the satellites and sometimes, the signal drops and go to acquiring forever.

2 - The way the sketch works is not helping either. It sends commands to the GPS module which blocks everything on it until it get a proper GPRMC. Then it sends a AT+GPS=0, then eratic commands if I refer to the TTY output where I got a series of random OK OK OK OK OK OK OK *OK OK * GPSRD=5 OK ....etc....
At some point, it resends the AT+GPS=1 followed by AT+GPSRD=1 and... you wait forever because the module is stuck.

3 - Using the GPSRD method adds an annoying +GPSRD: in front of the first line $GPGGA, parsers cannot understand that line.

Finally I ended up with a very basic setup to make sure that the GPS is working properly and I will see later how I could automate and parse that nicely with an Arduino UNO. I never achieved to lock a signal indoors though.

My goal is to make it working with an arduino mini pro or even an ATtiny.

Hardware:

  • Arduino UNO R3
  • A7 GPRS/GPS/GSM module (if you don't want to press that *$$$##@@ button everytime you power it, you can short v_BAT and PWR_KEY. It is documented ....in chinese...

Connections:

A7 UNO

U_TXD TX (pin1)
U_RXD RX (pin 0)
GND GND

Sketch:

Load a new blank sketch on the Arduino and once done, open a monitor at 9600 bauds.

Commands:

AT check connection, should reply OK

AT+GPS=1 start the GPS module, powers the GPS antenna at 1.79 V, start searching satellites and push data to GPS_TXD

AT+GPSRD=1 forwards the GPS data to the UART ports whilst still pushing the data on GPS_TXD

GPS_TXD can be connected to TX on UNO once the GPS module has been started.

AT+GPS=0 stops the GPS module and stops the power on the GPS antenna

AT+GPSRD=0 stops the forwarding of GPS data to the console while keeping the data flow to GPS_TXD

If you want to check the data, there is a free online parser here

Hi sir tcotduino01 and -dev

I've tried the suggestions from both of you, but it does not work both...

so i've another sample from this but i stuck on "AT+CPIN?" and wait forever because the module is stuck.

Connection :

A7 ====== UNO

GND ==> GND
GPS_TXD ==> PIN 10
U_TXD ==> PIN 0
U_RXD ==> PIN 1

for power A7 i use external power adaptor 9v also i connected the pwr_key pin to v_bat pin.
for power uno i use usb cable.

here the following my code :

#include <NeoSWSerial.h>
NeoSWSerial gps(10,11); // RX, TX

//String str="";
char str[70]; //is used for storing received message from GSM module
String gpsString=""; //is used for storing GPS string

char *test="$GPGGA"; //is used to compare the right string that we need for coordinates.

String latitude="No Range      ";
String longitude="No Range     ";

int temp=0,i;
boolean gps_status=0;

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

  Serial.println("Vehicle Tracking");
  
  delay(2000);
  gsm_init();
  
  Serial.println("AT+CNMI=2,2,0,0,0");
  Serial.println("GPS Initializing");
  
  Serial.println("  No GPS Range  ");
  get_gps();
  delay(2000);
  
  Serial.println("GPS Range Found");
  
  Serial.println("GPS is Ready");
  delay(2000);
  
  Serial.println("System Ready");
  temp=0;
}

void loop()
{
  serialEvent();
  if(temp)
  {
    get_gps();
    tracking();
  }
}

void serialEvent() //is used for receiving message from GSM and comparing the received message with predefined message (Track Vehicle).
{
  while(Serial.available())
  {
    if(Serial.find("Track Vehicle"))
    {
      temp=1;
      break;
    }
    else
    temp=0;
  }
}

void gpsEvent() // is used for receiving GPS data into the Arduino.
{
  gpsString="";
  while(1)
  {
   while (gps.available()>0)            //checking serial data from GPS
   {
    char inChar = (char)gps.read();
     gpsString+= inChar;                    //store data from GPS into gpsString
     i++;
     if (i < 7)                      
     {
      if(gpsString[i-1] != test[i-1])         //checking for $GPGGA sentence
      {
        i=0;
        gpsString="";
      }
     }
    if(inChar=='\r')
    {
     if(i>65)
     {
       gps_status=1;
       break;
     }
     else
     {
       i=0;
     }
    }
  }
   if(gps_status)
    break;
  }
}


// gsm_init() is used for initialising and configuring the GSM Module, where firstly, GSM module is checked whether it is connected or not by sending ‘AT’ command to GSM module. 
// If response OK is received, means it is ready. System keeps checking for the module until it becomes ready or until ‘OK’ is received. 
// Then ECHO is turned off by sending the ATE0 command, otherwise GSM module will echo all the commands. 
// Then finally Network availability is checked through the ‘AT+CPIN?’ command, if inserted card is SIM card and PIN is present, it gives the response +CPIN: READY. 
// This is also check repeatedly until the network is found. This can be clearly understood by the link Video : https://www.youtube.com/watch?v=2Ud6sB3A8j0

void gsm_init()
{
  
  Serial.println("Finding Module..");
  boolean at_flag=1;
  while(at_flag)
  {
    Serial.println("AT");
    while(Serial.available()>0)
    {
      if(Serial.find("OK"))
      at_flag=0;
    }
    
    delay(1000);
  }

  
  Serial.println("Module Connected..");
  delay(1000);
  
  Serial.println("Disabling ECHO");
  boolean echo_flag=1;
  while(echo_flag)
  {
    Serial.println("ATE0");
    while(Serial.available()>0)
    {
      if(Serial.find("OK"))
      echo_flag=0;
    }
    delay(1000);
  }

  
  Serial.println("Echo OFF");
  delay(1000);
  Serial.println("Finding Network..");
  boolean net_flag=1;
  while(net_flag)
  {
    Serial.println("AT+CPIN?");
    while(Serial.available()>0)
    {
      if(Serial.find("+CPIN: READY"))
      net_flag=0;
    }
    delay(1000);
  }
  Serial.println("Network Found..");
  delay(1000);
  
}

void get_gps() //has been used to extract the coordinates from the received string.
{
   gps_status=0;
   int x=0;
   while(gps_status==0)
   {
    gpsEvent();
    int str_lenth=i;
    latitude="";
    longitude="";
    int comma=0;
    while(x<str_lenth)
    {
      if(gpsString[x]==',')
      comma++;
      if(comma==2)        //extract latitude from string
      latitude+=gpsString[x+1];     
      else if(comma==4)        //extract longitude from string
      longitude+=gpsString[x+1];
      x++;
    }
    int l1=latitude.length();
    latitude[l1-1]=' ';
    l1=longitude.length();
    longitude[l1-1]=' ';
    Serial.println("Lat:");
    Serial.println(latitude);
    Serial.println("Long:");
    Serial.println(longitude);
    i=0;x=0;
    str_lenth=0;
    delay(2000);
   }
}

void init_sms() //used to initialising and sending message
{
  Serial.println("AT+CMGF=1");
  delay(400);
  Serial.println("AT+CMGS=\"+62**********\"");   // use your 10 digit cell no. here
  delay(400);
}

void send_data(String message)
{
  Serial.println(message);
  delay(200);
}

void send_sms() //used to initialising and sending message
{
  Serial.write(26);
}

void lcd_status()
{
  
  Serial.println("Message Sent");
  delay(2000);
  Serial.println("System Ready");
  return;
}

void tracking()
{
    init_sms();
    send_data("Vehicle Tracking Alert:");
    send_data("Your Vehicle Current Location is:");
    Serial.print("Latitude:");
    send_data(latitude);
    Serial.print("Longitude:");
    send_data(longitude);
    send_data("Please take some action soon..\nThankyou");
    send_sms();
    delay(2000);
    lcd_status();
}

is there something wrong with the code ?

hi guys

but when i use this code

#include <SoftwareSerial.h>

byte RX = 10; // This is your RX-Pin on Arduino UNO,connect with A7 UTXD pin
byte TX = 11; // This is your TX-Pin on Arduino UNO,connect with a7 URXD pin
SoftwareSerial *A7board = new SoftwareSerial(RX, TX); 

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

void setup() {
  Serial.begin(115200);
  A7board->begin(115200);
  delay(200); 

  Serial.println("Send AT command");  
  A7board->println("AT");
  delay(25000);
  print_result();
  
  Serial.println("AT+GPS turn on");  
  A7board->println("AT+GPS=1");  
  delay(10000);
  print_result();
  
  Serial.println("AT+GPSRD turn on");  
  A7board->println("AT+GPSRD=1");  
  delay(10000);
  print_result();






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

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

serial monitor showing this :

Send AT command
A7 board info: OK


)⸮TZV:17/10/0n,14:25:36,)`7


⸮⸮RQ⸮'⸮⸮⸮٥⸮⸮⸮⸮j

AT+GPS turn on
A7 board info: AT+GPS=1
OK


AT+GPSRD turn on
A7 board info: AT+GPSQD=1

OK

)⸮PSRD:$GPGT⸮bbbbb⸮b⸮⸮babj⸮bj⸮b⸮⸮⸮⸮R⸮⸮j
$GP


A7 board info: 
+GPSRD:$G⸮GGA,,,,,,0.00,,,M,,M,,0000*66
$GPQMC,,V,,,,,,&,,,N


A7 board info: 
)⸮PSRD:$GPGG@\,,,,,0,00,.,M,,M,,0000)66
$GPGSA,P)bbbbbbbbbab


A7 board info: 
+GPSRB:$GPGGA,,,.,,0,00,,,M,.M,,0000*66
	$GPRMC,,V,,.,,,,,,,N
A7 board info: 
+GPSRD:$u⸮bbbbb⸮b⸮⸮bbbj⸮bj⸮b⸮⸮⸮⸮R⸮⸮j
$GPQMC,,V,,,,,,.,,,N*


A7 board info: 
+GPSRD:$G⸮GGA,,,,,,0.00,,,M,,M,,0000*66
$GPG⸮A,A,1,,,,,.,,,,

what is this, it is mean gps data ???

-dev:
Unfortunately, I see that GPS_TXD may not provide NMEA data (see reply #20).

If you tried this:

#include <AltSoftSerial.h>

AltSoftSerial A7board;

#define gpsPort Serial // just an alias so it is easier to read below

void loop()
{
  switch (state) {

...

case GPS_READING:
      while (gps.available( gpsPort )) { // parse the NMEA data from pin 0
        fix = gps.read(); // this structure now contains all the GPS fields



... and did not get any GPS data, then GPS_TXD does not work.

You may have to try the command sequence in reply #25.

You could try the NeoGPS example NMEA.ino. It expects to receive GPS data on Arduino pin 8, if you can connect it to the GPS_TXD pin. If you don't want to move wires, you must edit GPSport.h to use `Serial` (see Installation instructions).

Or try a simple echo test:



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

void loop()
{
  if (Serial.available()) // any GPS characters?
    Serial.write( Serial.read() ); // echo to Serial Monitor window
}



If you see NMEA sentences, like $GPRMC or $GPGGA, then GPS_TXD does work.

hi sir, have you read my latest post on this thread?

charlilio:

/dev:
Unfortunately, I see that GPS_TXD may not provide NMEA data (see reply #20).

If you tried this:

... have you read my latest post?

Please delete irrelevant parts of the quote. We do not need to read previous posts again.

SoftwareSerial *A7board = new SoftwareSerial(RX, TX);

Why are you using new? Just declare the variable:

SoftwareSerial A7board(RX, TX);

Then use a "." instead of "->":

   Serial.write( A7board.read() );
                        ^

Software serial ports rarely work at 115200.

Your sketch is receiving some GPS data, but

  1. The data is corrupted because the baud rate is too fast. Either connect the A7Board to Serial (or Serial1, Serial2 or Serial3 if your board has extra HardwareSerial ports), or figure out how to change the baud rate. AltSoftSerial might work better. Have you read this? Try the BEST choice first.

  2. The GPS device is not locked on to any satellites. Either get closer to a window or go outside. It can take 10 minutes or more to get the first fix.

Also, don't use delay. If you use delay, the Arduino does not do anything besides twiddle its thumbs. Characters may be arriving, but your sketch does not read them. Eventually, the input buffer overflows and characters start getting dropped. Do something like this instead:

void print_result_for( unsigned long waitMS )
{
  Serial.print( F("A7 board info: ") );  // F macro saves RAM!

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

void setup() {
  Serial.begin(115200);
  A7board.begin(115200);

  Serial.println( F("Send AT command") );
  A7board.println( F("AT") );
  print_result_for( 25000);

    ...

-dev:

  1. The data is corrupted because the baud rate is too fast. Either connect the A7Board to Serial (or Serial1, Serial2 or Serial3 if your board has extra HardwareSerial ports), or figure out how to change the baud rate. AltSoftSerial might work better. Have you read this? Try the BEST choice first.

  2. The GPS device is not locked on to any satellites. Either get closer to a window or go outside. It can take 10 minutes or more to get the first fix.

Also, don't use delay. If you use delay, the Arduino does not do anything besides twiddle its thumbs. Characters may be arriving, but your sketch does not read them. Eventually, the input buffer overflows and characters start getting dropped.

when i used connection

a7 <=> uno
gnd <=> gnd
gps_txd <=> pin 0 as rx

serial monitor showing this

Send AT command
A7 board info: Send AT command
A7 board info: 
A7 board info: 
A7 board info: 
A7 board info: 
A7 board info:

when i used connection

a7 <=> uno
gnd <=> gnd
gps_txd <=> pin 0 as rx
u_txd <=> pint 8 as rx
u_rxd <=> pin 9 as tx

serial monitor showing this

A7 board info: Send AT command
A7 board info: Send AT command
A7 board info: 
A7 board info: 
A7 board info: 
A7 board info: 
A7 board info: 
A7 board info:

and last i try this connection
a7 <=> uno
gnd <=> gnd
gps_txd <=> pin 0 as rx
u_txd <=> pint 10 as rx
u_rxd <=> pin 11 as tx

serial monitor showing this

Send AT command
A7 boarSend AT command
A7 board info: 
A7 board info: 
A7 board info: 
A7 board info: 
A7 board info:

I tried it in front of the open window, and I put a7 module outside the window along with its arduino

here the code i've try sir

#include <SoftwareSerial.h>

byte RX = 0; // This is your RX-Pin on Arduino UNO,connect with A7 UTXD pin
byte TX = 1; // This is your TX-Pin on Arduino UNO,connect with a7 URXD pin

// Connection
//     A7 ==== UNO
// GND     <=> GND
// GPS_TXD <=> PIN 0 as RX
// U_TXD   <=> PIN 10 as RX I do not know for tx and rx on a7 should be connected to what pin
// U_RXD   <=> PIN 11 as TX I do not know for tx and rx on a7 should be connected to what pin

SoftwareSerial A7board(RX, TX);

void print_result_for( unsigned long waitMS )
{
  Serial.print( F("A7 board info: ") );  // F macro saves RAM!

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

void setup() {
  Serial.begin(115200);
  A7board.begin(115200);

  Serial.println( F("Send AT command") );
  A7board.println( F("AT") );
  print_result_for( 25000);

}

void loop() {
  // put your main code here, to run repeatedly:
   print_result_for( 25000); // should ia put this function here ?
}

-dev:
Also, don't use delay. If you use delay, the Arduino does not do anything besides twiddle its thumbs. Characters may be arriving, but your sketch does not read them. Eventually, the input buffer overflows and characters start getting dropped. Do something like this instead:

i also try this code from another reference

connection

A7 <=> UNO

GND <=> GND
GPS_TXD <=> PIN 3 as rx
U_TXD <=> PIN 0 as rx
U_RXD <=> PIN 1 as tx

and here the code :

#include <SoftwareSerial.h>
#include <TinyGPS.h>

long lat,lon,latB,lonB;

SoftwareSerial gpsSerial(2,3); // (TX,RX)create gps sensor connection
TinyGPS gps; //create gps object

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);// connect serial
  gpsSerial.begin(115200);// connect gps sensor
}

void loop() {
  // put your main code here, to run repeatedly:
  while(gpsSerial.available()){//check for gps data
    if(gps.encode(gpsSerial.read())){//encode gps data
      gps.get_position(&lat,&lon);//get latitude and longitude
      latB=lat/100000;
      lonB=lon/100000;
      lat=lat-
      (latB*100000);
      lat=lat*(-1);
      lon=lon-
      (lonB*100000);
      Serial.print("AT+CMGS=");
      Serial.write(34);
      Serial.print("082129111432");
      Serial.write(34);Serial.write(13);
      Serial.print("\r\n");
      delay(1000);
      Serial.print("position:");
      Serial.print("\r\n");
      Serial.print("http://maps.google.com/maps?q=");
      Serial.print(latB);Serial.print(".");Serial.print(lat);
      Serial.print(",");// print latitude
      Serial.println(lonB);Serial.print(".");Serial.print(lon);//print langitude
      Serial.write(26);
      delay(5000);
    }
  }
}

fiyuuhh help me please to solved my problem T_T