Xinyuan-LilyGO / LilyGO-T-A76XX

LilyGo A7670X A7608X SIM7670G series
MIT License
128 stars 57 forks source link

A7670SA R2 With GPS not works #25

Closed felipesms closed 1 year ago

felipesms commented 2 years ago

Hello , So I have the module T-SIM-A7670-R2 (A7670SA R2 With GPS) I am using Arduino to program. I able to connect to the network but I couldn't get the GPS to work.

AT+CGNSSINFO +CGNSSINFO: ,,,,,,,,

thank you so much

LilyGO commented 2 years ago

Hello. Which example are you using? Also make sure the antenna is outdoors

felipesms commented 2 years ago

thanks... I tested outdoors with antenna

my code:

include "Arduino.h"

define TINY_GSM_MODEM_SIM7600 //The AT instruction of A7670 is compatible with SIM7600

define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb

define SerialAT Serial1

// See all AT commands, if wanted

define DUMP_AT_COMMANDS

define uS_TO_S_FACTOR 1000000ULL // Conversion factor for micro seconds to seconds

define TIME_TO_SLEEP 600 // Time ESP32 will go to sleep (in seconds)

define UART_BAUD 115200

define PIN_DTR 25

define PIN_TX 26

define PIN_RX 27

define PWR_PIN 4

define BAT_ADC 35

define BAT_EN 12

define PIN_RI 33

define RESET 5

define SD_MISO 2

define SD_MOSI 15

define SD_SCLK 14

define SD_CS 13

// Your GPRS credentials, if any const char apn[] = "zap.vivo.com.br"; const char gprsUser[] = "vivo"; const char gprsPass[] = "vivo";

include "int.cpp"

include

ifdef DUMP_AT_COMMANDS // if enabled it requires the streamDebugger lib

include

StreamDebugger debugger(SerialAT, Serial); TinyGsm modem(debugger);

else

TinyGsm modem(SerialAT);

endif

void modem_on() {

pinMode(BAT_EN, OUTPUT);
digitalWrite(BAT_EN, HIGH);

//A7670 Reset
pinMode(RESET, OUTPUT);
digitalWrite(RESET, LOW);
delay(100);
digitalWrite(RESET, HIGH);
delay(3000);
digitalWrite(RESET, LOW);

pinMode(PWR_PIN, OUTPUT);
digitalWrite(PWR_PIN, LOW);
delay(100);
digitalWrite(PWR_PIN, HIGH);
delay(1000);
digitalWrite(PWR_PIN, LOW);

}

bool reply = true;

// liga gps e flash // AT+CGNSSPWR=1,1

//AT+CGPSINFO void setup() { Serial.begin(115200); // Set console baud rate SerialAT.begin(115200, SERIAL_8N1, PIN_RX, PIN_TX); delay(10); modem_on();

modem.gprsConnect(apn, gprsUser, gprsPass);
delay(2000);

//turn on gps Serial.println("\n---Starting GPS TEST---\n"); SerialAT.println("AT+CGNSSPWR=1,1");

delay(10000);

if (modem.isGprsConnected()) {
    Serial.println("GPRS connected");
}

String ccid = modem.getSimCCID();
Serial.println("CCID: " + ccid);

String imei = modem.getIMEI();
Serial.println("IMEI: " + imei);

String cop = modem.getOperator();
Serial.println("Operator: " + cop);

IPAddress local = modem.localIP();
Serial.println("Local IP: " + String(local));

int csq = modem.getSignalQuality();
Serial.println("Signal quality: " + String(csq));

SerialAT.println("AT+CPSI?");     //Get connection type and band
modem.getModemInfo();

// get gps data

float lat,  lon;
if (modem.getGPS(&lat, &lon)) {     Serial.printf("lat:%f lon:%f\n", lat, lon);}

if (reply) {
    Serial.println(F("***********************************************************"));
    Serial.println(F(" You can now send AT commands"));
    Serial.println(F(" Enter \"AT\" (without quotes), and you should see \"OK\""));
    Serial.println(F(" If it doesn't work, select \"Both NL & CR\" in Serial Monitor"));
    Serial.println(F(" DISCLAIMER: Entering AT commands without knowing what they do"));
    Serial.println(F(" can have undesired consiquinces..."));
    Serial.println(F("***********************************************************\n"));
} else {
    Serial.println(F("***********************************************************"));
    Serial.println(F(" Failed to connect to the modem! Check the baud and try again."));
    Serial.println(F("***********************************************************\n"));
}

}

void loop() {

while (true) {
    if (SerialAT.available()) {
        Serial.write(SerialAT.read());
    }
    if (Serial.available()) {
        SerialAT.write(Serial.read());
    }
    delay(10);
}

}

LilyGO commented 2 years ago

Reference example

felipesms commented 2 years ago

Thanks, I used the code and add data APN. I sended for board. the chip not returned message of gps . Best regards for solutions. thanks. I from brazil, need the chip any command?

// log port com

getGPS 463441 AT+CGNSSINFO

+CGNSSINFO: ,,,,,,,,

OK getGPS 465446 AT+CGNSSINFO

+CGNSSINFO: ,,,,,,,,

OK getGPS 467451 AT+CGNSSINFO

+CGNSSINFO: ,,,,,,,,

OK getGPS 469456 AT+CGNSSINFO

+CGNSSINFO: ,,,,,,,,

OK getGPS 471461 AT+CGNSSINFO

+CGNSSINFO: ,

felipesms commented 2 years ago

OK Modem Name: A7670SA-FASE

Manufacturer: INCORPORATED Model: A7670SA-FASE Revision: A7670M7_V1.11.1 IMEI: 869731052065927 +GCAP: +CGSM,+FCLASS,+DS

https://imgur.com/a/b6ajZV3

LilyGO commented 2 years ago

Is the antenna wired right. Can you take a picture of your board?

felipesms commented 2 years ago

link https://imgur.com/a/jLZ0BI8

thanks

LilyGO commented 2 years ago

Leave the example unchanged. Connect the MicroUSB and open the serial port with NMEA. See if there is data output . (The board needs to be positioned outdoors)

felipesms commented 2 years ago

UHHHHHHHHHHHHHHH

CGNSSINFO: ,,,,,,,,

OK getGPS 59215 AT+CGNSSINFO

+CGNSSINFO: ,,,,,,,,

OK getGPS 61220 AT+CGNSSINFO

+CGNSSINFO: 3,08,,00,00,1947.80135,S,04354.86991,W,151122,124230.00,802.6,0.414,,12.,5.1,10.

OK lat:-0.000000 lon:-0.000000 AT+CGPS=0

All ready.

thanks

lewisxhe commented 1 year ago

Here are the debugging tips for GNSS of A7670 GPS version: Burn ATDebug, and then send commands in the following order


AT+CGDRT=4,1
AT+CGSETV=4,0

AT+CGNSSPWR=1

Waiting to return >  +CGNSSPWR: READY! 
Next send

AT+CGNSSMODE=3
AT+CGNSSNMEA=1,1,1,1,1,1,0,0
AT+CGPSNMEARATE=2
AT+CGNSSTST=1
AT+CGNSSPORTSWITCH=0,1

Check whether the GPS NMEA message will be output to the AT port

The final effect is shown in the following figure:

image

felipesms commented 1 year ago

Hello, thank you very much. I will try .

lewisxhe commented 1 year ago

Hello, thank you very much. I will try .

Please try again according to the above command

Anonymouse-X commented 1 year ago

I always get this on my serial monitor

setup... SDCard MOUNT FAIL

Wait... Initializing modem... AT AT AT AT AT AT AT AT AT AT AT AT AT AT AT AT AT AT AT AT

*ATREADY: 1 AT OK ATE0 AT OK AT+CMEE=0 AT OK AT+CTZR=0 ATE0 OK AT+CTZU=1

OK AT+CPIN?

OK

OK

ERROR AT+CPIN?

*ISIMAID: "A0000000871004FFFFF00189000001FF"

+CPIN: READY

+CPIN: READY

OK AT+CGMM

A7670SA-FASE

OK Modem Name: A7670SA-FASE ATI

Manufacturer: INCORPORATED Model: A7670SA-FASE Revision: A7670M7_V1.11.1 IMEI: 869731051383453 +GCAP: +CGSM,+FCLASS,+DS

OK Initializing modem... AT

OK ATE0

OK AT+CMEE=0

OK AT+CTZR=0

OK AT+CTZU=1

OK AT+CPIN?

+CPIN: READY

OK AT+CGMM

A7670SA-FASE

OK Modem Name: A7670SA-FASE ATI

Manufacturer: INCORPORATED Model: A7670SA-FASE Revision: A7670M7_V1.11.1 IMEI: 869731051383453 +GCAP: +CGSM,+FCLASS,+DS

OK AT+CGNSSPWR=0

SMS DONE

+CGEV: EPS PDN ACT 1

OK AT+CGNSSPWR=1

OK Wait GPS reday........ +CGNSSPWR: READY! AT+CGNSSMODE=1

OK AT+CGNSSINFO

+CGNSSINFO: ,,,,,,,,

OK getGPS 23942 AT+CGNSSINFO

PB DONE

+CGNSSINFO: ,,,,,,,,

OK getGPS 25949 AT+CGNSSINFO

+CGNSSINFO: ,,,,,,,,

OK getGPS 27956 AT+CGNSSINFO

+CGNSSINFO: ,,,,,,,,

OK getGPS 29963

lewisxhe commented 1 year ago

It can be seen that you did not operate according to the above method. When you turn on the GPS, you must turn on the power supply of the end of the world, otherwise you will not receive any satellite signals

https://github.com/Xinyuan-LilyGO/T-A7670X/issues/25#issuecomment-1346243254

deeja commented 1 year ago

The GPS antenna that came with the device isn't working as well as other antennas I have. I have swapped the antenna and now the GPS fix happens in seconds.

HDC67 commented 1 year ago

I have swapped the antenna

Could you link the antenna you used for reference?

deeja commented 1 year ago

It's from a local supplier, but as long as it has the u.FL connector, then you should be ok. Drone GPS antennas usually have that connection.

PequinhaSander commented 6 months ago

Onde posso arrumar uma firmware do a7670sa open ?? Para fazer modificações

PequinhaSander commented 6 months ago

Gostaria de modificar o nome da versão que aparece quando consulto pelo SMS com o comando version#, alguém pode me ajudar como consigo alterar ?