I connected my gps module (NEO-6M) with esp32doit-devkit-v1 board. The module provided data but many data are missing.
My pin configuration:
GPS ------- ESP32
VCC ------- 3v3
GND ------- GND
TX -------- RX2 (pin 16)
RX -------- TX2 (pin 17)
Baud Rate: 9600
My code:
#include <Arduino.h>
#include <TinyGPS++.h>
#define TXD2 17
#define RXD2 16
TinyGPSPlus gps;
void setup()
{
Serial.begin(115200);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial.println("Started......");
}
void loop()
{
while (Serial2.available())
{
Serial.write(Serial2.read());
// gps.encode(Serial2.read());
// if (gps.location.isValid())
// {
// Serial.print("Latitude= ");
// Serial.print(gps.location.lat(), 6);
// Serial.print(" Longitude= ");
// Serial.println(gps.location.lng(), 6);
// }
}
}
OUTPUT
-
The output looks perfectly fine. You just don't have a GPS signal.Majenko– Majenko05/31/2019 08:03:25Commented May 31, 2019 at 8:03
-
@Majenko is right put your GPS outside (in open sky) then you will the latitude and longitude with other parameters as well.Vaibhav– Vaibhav05/31/2019 16:20:16Commented May 31, 2019 at 16:20
1 Answer 1
GPS seems to be working and informing you that you have no signal. Usually happens inside buildings, when far from a window or when antenna isnt properly connected.
Testing out of doors is many times not possible, so try placing your antenna next to a window with a partial view of the sky. Wait for a couple of minutes until you get a fix on 4 or 5 satellites.
-
have also found this happens when the power to the module is lower than needed, for example 5v being shared with other modules such as a 1602 displayRob– Rob08/23/2020 14:56:14Commented Aug 23, 2020 at 14:56