Skip to content

Commit

Permalink
fix gps must be 115k
Browse files Browse the repository at this point in the history
  • Loading branch information
designer2k2 committed Feb 26, 2024
1 parent e167dd9 commit 43aee72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/fromV08.ino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void do_send(osjob_t* j) {
Serial.println(F("OP_TXRXPEND, not sending"));
LoraStatus = "OP_TXRXPEND, not sending";
} else {
if (gps.checkGpsFix() && ((dist_moved > min_dist_moved) || (millis() > (last_send_ms + STATIONARY_TX_INTERVAL)))) {
if (gps.checkGpsFix() && ((dist_moved > min_dist_moved) || (millis() > (last_send_ms + STATIONARY_TX_INTERVAL * 1000)))) {
// Prepare upstream data transmission at the next possible time.
gps.buildPacket(txBuffer);
last_send_lat = gps.tGps.location.lat();
Expand Down Expand Up @@ -620,6 +620,8 @@ void loop() {
} else {
display.print("v");
}
display.setCursor(0, 0);
display.print("SAT: " + String(gps.tGps.satellites.value()));
}
redraw = true;
}
Expand Down
16 changes: 10 additions & 6 deletions src/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ HardwareSerial GPSSerial(1);

void gps::init() {
GPSSerial.setRxBufferSize(2048); // Default is 256
GPSSerial.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX);
GPSSerial.begin(115200, SERIAL_8N1, GPS_TX, GPS_RX);
GPSSerial.setTimeout(2);

// CFG-PRT to 115200 Baudrate
Expand Down Expand Up @@ -42,12 +42,12 @@ void gps::init() {

for (byte i = 0; i < sizeof(packet); i++)
{
GPSSerial.write(packet[i]);
//GPSSerial.write(packet[i]);
}

delay(100);
GPSSerial.flush();
GPSSerial.updateBaudRate(115200);
//delay(100);
//GPSSerial.flush();
//GPSSerial.updateBaudRate(115200);
}

void gps::encode() {
Expand Down Expand Up @@ -104,7 +104,11 @@ bool gps::checkGpsFix() {
Serial.println("Valid gps Fix.");
return true;
} else {
Serial.println("No gps Fix.");
Serial.print("No gps Fix. ");
Serial.print(tGps.failedChecksum());
Serial.print(" Failed Checksums, ");
Serial.print(tGps.charsProcessed());
Serial.println(" Chars Ok");
return false;
}
}

0 comments on commit 43aee72

Please sign in to comment.