Chat freely about anything...

User avatar
By tmorford
#51194 Hello all I have code that reads a GPS signal using tinygps++ and SoftwareSerial to connect to it. I wire it all up to the NodeMCU everything works just fine, when I use the same code I get no GPS signal, I have loaded the NodeMCU firmware on the ESP chip also just incase that was the problem. Code Snippet:

Code: Select allstatic const int RXPin = 12, TXPin = 255;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps; 
SoftwareSerial ss(RXPin, TXPin); 

static void smartDelay(unsigned long ms)               
{
  unsigned long start = millis();
  do
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

void setup() {
    ss.begin(GPSBaud);
}
void loop() {
if (millis() > 5000 && gps.charsProcessed() < 10) {
          Serial.println(F("No GPS data received: check wiring"));
        }
        else
        {
Serial.print("Latitude  : ");
  Serial.println(gps.location.lat(), 6);
  Serial.print("Longitude : ");
  Serial.println(gps.location.lng(), 6);
  Serial.print("Speed : ");
  Serial.println(gps.speed.mph(), 6);
  Serial.print("I : ");
  Serial.println(i);
  Serial.print("Satellites: ");
  Serial.println(gps.satellites.value());
  Serial.print("Battery VCC: ");
  Serial.println(String(batVcc));
  Serial.print("Time UTC  : ");
  Serial.print(gps.time.hour());                       
  Serial.print(":");
  Serial.print(gps.time.minute());                     
  Serial.print(":");
  Serial.println(gps.time.second());
}
}


I am not sure what the problem is, I read that there is a different SoftwareSerial for ESP8266 and I tried that and I could not get it to work correctly. Any help would be great! Thanks!