Link of the NEO-M8N I'm using: NEO-M8N
Link of the Arduino Uno R3 (Clone): Arduino R3
A few days later my NEO-M8N worked fine but after that, I tried to test it again with the same code but it is not getting any data even with a blue LED is blinking.
It is working fine when i try use U-Center apps and it's getting a fixed....
#include <TinyGPS++.h>
#ifdef ESP32
#include <HardwareSerial.h>
HardwareSerial mygps(2);
#elif defined(ESP8266)
#include <SoftwareSerial.h>
SoftwareSerial mygps(D5, D6);
#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
#include <SoftwareSerial.h>
SoftwareSerial mygps(4, 3);
#else
#error "Unsupported microcontroller! This code is for ESP32, ESP8266, ATmega328, or ATmega168."
#endif
TinyGPSPlus gps;
void setup() {
Serial.begin(9600);
mygps.begin(9600);
delay(1000);
Serial.println("\nGPS Testing");
}
void loop() {
while (mygps.available() > 0) {
if (gps.encode(mygps.read()) || gps.location.isUpdated()) {
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 6);
Serial.print("\tLongitude= ");
Serial.println(gps.location.lng(), 6);
delay(1000);
}
}
}
I've also tried NeoGPS Library and still not getting any data.
NeoGPS Library
#include <NMEAGPS.h>
#include <SoftwareSerial.h>
SoftwareSerial mygps(4, 3); // RX, TX
NMEAGPS gps;
gps_fix fix;
void setup() {
Serial.begin(9600);
mygps.begin(9600);
Serial.println("GPS Module Initialized...");
}
void loop() {
if (gps.available(mygps)) {
fix = gps.read();
if (fix.valid.location) {
Serial.print("Latitude: ");
Serial.print(fix.latitude(), 6);
Serial.print(" Longitude: ");
Serial.println(fix.longitude(), 6);
} else {
Serial.println("Waiting for GPS fix...");
}
}
}



