I have been working on a little project and I am stucked on this since some weeks ago, i am very newbie on it, could you help me out? I want to get the gps data using RYS8830 EVB but I am getting "No GPS detected: check wiring." always, both devices connected to usb laptop. Using the software I could see the location very accurate.
Devices list:
1) ESP32 DEV KIT v1
2) Reyax RYS8830 GPS/GNSS Receiver Module EVB
3) 8-channel Bi-directional Logic Level Converter - TXB0108 (3.3v - 1.8v)
My wired is the following (jumper activaded on UART protocol on GPS EVB): Based on the documentarion I have used the RX,TX,Ground and 1.8V output as following:
EVB RX -> ESP32 TX
EVB TX -> ESP32 RX
The code is:
Code: Select all
#include <TinyGPSPlus.h>
const int rx = 16;
const int tx = 17;
static const uint32_t serialBaud = 115200;
// The TinyGPSPlus object
TinyGPSPlus gps;
String incoming = "";
void setup()
{
Serial.begin(serialBaud);
Serial2.begin(serialBaud, SERIAL_8N1, rx, tx);
delay(1000);
writeDataToGPS("@GSTP");
delay(100);
writeDataToGPS("@GNS 47");
delay(100);
writeDataToGPS("@GSR");
delay(100);
Serial.println("SETUP");
}
void loop()
{
// This sketch displays information every time a new sentence is correctly encoded.
while (Serial2.available() > 0) {
if (Serial.println(Serial2.read())) {
Serial.println(F("GPS detected."));
displayInfo();
}
}
if (millis() > 5000 && gps.charsProcessed() < 10)
{
Serial.println(F("No GPS detected: check wiring."));
while(true);
}
}
void writeDataToGPS(String data)
{
String content = "";
content = data + "\r\n";
char* bufc = (char*) malloc(sizeof(char) * content.length() + 1);
content.toCharArray(bufc, content.length() + 1);
Serial2.write(bufc);
free(bufc);
}
void displayInfo()
{
if (gps.location.isValid())
{
char data[20];
sprintf(data, "%lf,%lf|", gps.location.lat(), gps.location.lng());
Serial.println(gps.location.lat());
Serial.write(data);
Serial.flush();
delay(100);
}
}
Thank you in advanced!!