Skip to content

Commit

Permalink
Fixed L76K probe
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Jan 10, 2025
1 parent 9aa3e4c commit fba7d1e
Show file tree
Hide file tree
Showing 49 changed files with 1,617 additions and 1,617 deletions.
66 changes: 33 additions & 33 deletions examples/ArduinoLoRa/LoRaReceiver/LoRaBoards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,43 +914,43 @@ bool beginGPS()
SerialGPS.begin(GPS_BAUD_RATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
bool result = false;
uint32_t startTimeout ;
for (int i = 0; i < 3; ++i) {
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.flush();

while (SerialGPS.available()) {
// Serial.print(".");
Serial.flush();
SerialGPS.flush();
while (SerialGPS.available()) {
Serial.print(".");
SerialGPS.readString();
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
break;
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
delay(500);
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
}
delay(500);

// Initialize the L76K Chip, use GPS + GLONASS
SerialGPS.write("$PCAS04,5*1C\r\n");
delay(250);
Expand Down
66 changes: 33 additions & 33 deletions examples/ArduinoLoRa/LoRaSender/LoRaBoards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,43 +914,43 @@ bool beginGPS()
SerialGPS.begin(GPS_BAUD_RATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
bool result = false;
uint32_t startTimeout ;
for (int i = 0; i < 3; ++i) {
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.flush();

while (SerialGPS.available()) {
// Serial.print(".");
Serial.flush();
SerialGPS.flush();
while (SerialGPS.available()) {
Serial.print(".");
SerialGPS.readString();
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
break;
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
delay(500);
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
}
delay(500);

// Initialize the L76K Chip, use GPS + GLONASS
SerialGPS.write("$PCAS04,5*1C\r\n");
delay(250);
Expand Down
66 changes: 33 additions & 33 deletions examples/BPFFactory/LoRaBoards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,43 +914,43 @@ bool beginGPS()
SerialGPS.begin(GPS_BAUD_RATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
bool result = false;
uint32_t startTimeout ;
for (int i = 0; i < 3; ++i) {
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.flush();

while (SerialGPS.available()) {
// Serial.print(".");
Serial.flush();
SerialGPS.flush();
while (SerialGPS.available()) {
Serial.print(".");
SerialGPS.readString();
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
break;
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
delay(500);
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
}
delay(500);

// Initialize the L76K Chip, use GPS + GLONASS
SerialGPS.write("$PCAS04,5*1C\r\n");
delay(250);
Expand Down
66 changes: 33 additions & 33 deletions examples/Display/Free_Font_Demo/LoRaBoards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,43 +914,43 @@ bool beginGPS()
SerialGPS.begin(GPS_BAUD_RATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
bool result = false;
uint32_t startTimeout ;
for (int i = 0; i < 3; ++i) {
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.flush();

while (SerialGPS.available()) {
// Serial.print(".");
Serial.flush();
SerialGPS.flush();
while (SerialGPS.available()) {
Serial.print(".");
SerialGPS.readString();
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
break;
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
delay(500);
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
}
delay(500);

// Initialize the L76K Chip, use GPS + GLONASS
SerialGPS.write("$PCAS04,5*1C\r\n");
delay(250);
Expand Down
66 changes: 33 additions & 33 deletions examples/Display/TBeam_TFT_Shield/LoRaBoards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,43 +914,43 @@ bool beginGPS()
SerialGPS.begin(GPS_BAUD_RATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
bool result = false;
uint32_t startTimeout ;
for (int i = 0; i < 3; ++i) {
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.write("$PCAS03,0,0,0,0,0,0,0,0,0,0,,,0,0*02\r\n");
delay(5);
// Get version information
startTimeout = millis() + 3000;
Serial.print("Try to init L76K . Wait stop .");
SerialGPS.flush();

while (SerialGPS.available()) {
// Serial.print(".");
Serial.flush();
SerialGPS.flush();
while (SerialGPS.available()) {
Serial.print(".");
SerialGPS.readString();
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
if (millis() > startTimeout) {
Serial.println("Wait L76K stop NMEA timeout!");
return false;
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
break;
};
Serial.println();
SerialGPS.flush();
delay(200);

SerialGPS.write("$PCAS06,0*1B\r\n");
startTimeout = millis() + 500;
String ver = "";
while (!SerialGPS.available()) {
if (millis() > startTimeout) {
Serial.println("Get L76K timeout!");
return false;
}
delay(500);
}
SerialGPS.setTimeout(10);
ver = SerialGPS.readStringUntil('\n');
if (ver.startsWith("$GPTXT,01,01,02")) {
Serial.println("L76K GNSS init succeeded, using L76K GNSS Module\n");
result = true;
}
delay(500);

// Initialize the L76K Chip, use GPS + GLONASS
SerialGPS.write("$PCAS04,5*1C\r\n");
delay(250);
Expand Down
Loading

0 comments on commit fba7d1e

Please sign in to comment.