Skip to content

Commit

Permalink
Update examples #132
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Aug 29, 2024
1 parent 3907944 commit 59b4290
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 5 deletions.
1 change: 1 addition & 0 deletions examples/GPSShield/GPSShield.ino
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void setup()
//GPS Serial port
SerialGPS.begin(9600, SERIAL_8N1, BOARD_GPS_RX_PIN, BOARD_GPS_TX_PIN);

// Ref issue : https://github.com/Xinyuan-LilyGO/LilyGO-T-A76XX/issues/56#issuecomment-1672628977
Serial.println("This sketch is only suitable for boards without GPS function inside the modem, such as A7670G");

Serial.println("Works only with externally mounted GPS modules. If the purchased board includes a GPS extension module it will work, otherwise this sketch will have no effect");
Expand Down
20 changes: 20 additions & 0 deletions examples/GPS_BuiltIn/GPS_BuiltIn.ino
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ void setup()
Serial.println();
delay(200);

String modemName = "UNKOWN";
while (1) {
modemName = modem.getModemName();
if (modemName == "UNKOWN") {
Serial.println("Unable to obtain module information normally, try again");
delay(1000);
} else if (modemName.startsWith("A7670G")) {
while (1) {
Serial.println("A7670G does not support built-in GPS function, please run examples/GPSShield");
delay(1000);
}
} else {
Serial.print("Model Name:");
Serial.println(modemName);
break;
}
delay(5000);
}


Serial.println("Enabling GPS/GNSS/GLONASS");
while (!modem.enableGPS(MODEM_GPS_ENABLE_GPIO)) {
Serial.print(".");
Expand Down
23 changes: 18 additions & 5 deletions examples/GPS_NMEA_Output/GPS_NMEA_Output.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ TinyGsm modem(SerialAT);

uint32_t check_interval = 0;

void displayInfo();

void setup()
{
Expand Down Expand Up @@ -81,10 +80,24 @@ void setup()
delay(200);


Serial.println("Before running, please check whether the version you purchased supports the GPS function. Regardless of whether the PCB contains an antenna connector, the A7670G does not include a built-in GPS function. If the A7670G you purchased claims to support GPS, then please run examples/GPSShield\n\n");
Serial.println("Before running, please check whether the version you purchased supports the GPS function. Regardless of whether the PCB contains an antenna connector, the A7670G does not include a built-in GPS function. If the A7670G you purchased claims to support GPS, then please run examples/GPSShield\n\n");
Serial.println("Before running, please check whether the version you purchased supports the GPS function. Regardless of whether the PCB contains an antenna connector, the A7670G does not include a built-in GPS function. If the A7670G you purchased claims to support GPS, then please run examples/GPSShield\n\n");

String modemName = "UNKOWN";
while (1) {
modemName = modem.getModemName();
if (modemName == "UNKOWN") {
Serial.println("Unable to obtain module information normally, try again");
delay(1000);
} else if (modemName.startsWith("A7670G")) {
while (1) {
Serial.println("A7670G does not support built-in GPS function, please run examples/GPSShield");
delay(1000);
}
} else {
Serial.print("Model Name:");
Serial.println(modemName);
break;
}
delay(5000);
}

retry = 15;
Serial.println("Enabling GPS/GNSS/GLONASS");
Expand Down
21 changes: 21 additions & 0 deletions examples/GPS_NMEA_Parse/GPS_NMEA_Parse.ino
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,27 @@ void setup()
}
Serial.println();


String modemName = "UNKOWN";
while (1) {
modemName = modem.getModemName();
if (modemName == "UNKOWN") {
Serial.println("Unable to obtain module information normally, try again");
delay(1000);
} else if (modemName.startsWith("A7670G")) {
while (1) {
Serial.println("A7670G does not support built-in GPS function, please run examples/GPSShield");
delay(1000);
}
} else {
Serial.print("Model Name:");
Serial.println(modemName);
break;
}
delay(5000);
}


delay(200);

Serial.println("Enabling GPS/GNSS/GLONASS");
Expand Down

0 comments on commit 59b4290

Please sign in to comment.