GNSS not working

Hello, everyone!
I’m a new programmer and I just bought a Wireless Tracker. I’m using Arduino IDE to build my code to test the GPS, with the examples of the library TinyGPSPlus (simples code to print latitude and longitude). However, it seems that the GPS is not being initialized correctly, since no coordinates are shown on the serial.
I’m using Pins 34 for RX and 33 for TX. I’m not sure if I need to conect anything physically on the board on those pins, the only thing I connected was the antenna on the GNSS pin on the back of the board. Is there anything else I should define on the code? Is there any configuration I should do on the board? Do you have any example code for me to test it? I just need to read the latitude and longitude from the GPS.
I really don’t know what I’m doing wrong!!

CODE:
#include <HardwareSerial.h>

#include <TinyGPS++.h>

HardwareSerial Serialgps(2);

TinyGPSPlus gps;

void setup() {

pinMode(46,OUTPUT);

pinMode(3,OUTPUT);

digitalWrite(3,HIGH);

Serial.begin(115200);

Serialgps.begin(9600, SERIAL_8N1, 33, 34); // Pins 34 (RX) 33 (TX)do GPS

}

void loop() {

if (Serialgps.available()) {

int c = Serialgps.read();

if (gps.encode(c)) {

 

  if (gps.location.isUpdated()) {

    float gpslatitude = gps.location.lat();

    float gpslongitude = gps.location.lng();

   

    Serial.print("Latitude: ");

    Serial.println(gpslatitude, 6);

    Serial.print("Longitude: ");

    Serial.println(gpslongitude, 6);

   

  }

}

}

}


Hope to be helpful to your friend

Which version of the board do you own, V1.1? When this is the case, your GPIO pins and baud rate might not be right. For these boards, I use the following code:
#define GNSS_TX 33
#define GNSS_RX 34
#define GNSS_RST 35
#define GNSS_PPS 36
#define GNSS_BAUD 115200UL
Serial1.begin(GNSS_BAUD, SERIAL_8N1, GNSS_TX, GNSS_RX);

@ksjh I tried using our tips and for sure now the GNSS is probably on, but is still not reading the values correctly! I’m now using the example below, but in the Serial Monitor, when I print the values from the Serial1.read, these are the lines that appear:
$GNRMC,V,N,V37
$GNGGA,0,00,99.99,56
$GNGSA,A,1,99.99,99.99,99.99,1
33
$GNGSA,A,1,99.99,99.99,99.99,2
30
$GNGSA,A,1,99.99,99.99,99.99,436
$GNGSA,A,1,99.99,99.99,99.99,3
31
$GNGSA,A,1,99.99,99.99,99.99,537
$GPGSV,1,1,00,1
64
$GPGSV,1,1,00,86D
$GLGSV,1,1,00,1
78
$GBGS1,0,000002,0000,0000,0000,136.095,0*74
0000-00-00 99:99:99.00
LAT 0.000000
LON 0.000000
ALT 0.000
HDOP 25.5
NMEA invalid.

I went outdoors to try it, and the only thing that appears is the correct date and the wrong time (don’t know the reason that the time is 3 hours ahead), but latitude and longitude still zero!
Any idea of what it can be?

EXAMPLE LINK: https://github.com/ksjh/HTIT-Tracker/blob/main/src/MicroNMEA-serial.cpp

The first time it can take well up to 15 minutes before you get a full GNSS lock, as the device needs to figure out where on the world it is. Next time around (within ~4 hours) it will have a pretty good idea as the satellites haven’t moved too much and take a few tens of seconds, after those ~4 hours it’ll take medium-long to get the location lock (up to a minute or so). After ~4 weeks off it may take up to 15 minutes again.
Those numbers assume a reasonable view of clear sky.

@bns thanks for the help! I was definitely not patient enough kkk Now everything works perfectly!
Also thanks @ksjh and uther for all the support!

1 Like