I'm trying to connect my GPS unit to an Arduino Uno, but for whatever reason, it cannot find any satellites. The code pasted below is the official code from Sparkfun. I have it wired up as shown on the hardware guide from the website (simple; just connected using the Qwiic connector).
As far as I can tell, the code is working correctly (I'm getting a response, only prints "No Fix - Num. satellites: 0" I don't understand why we aren't picking up any satellites? I've tried going to different places to try and see if anything changes, but nothing has :\.
#include <Wire.h> //Needed for I2C to GPS
#include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_Ublox_GPS
SFE_UBLOX_GPS myGPS;
#include <MicroNMEA.h> //http://librarymanager/All#MicroNMEA
char nmeaBuffer[100];
MicroNMEA nmea(nmeaBuffer, sizeof(nmeaBuffer));
void setup()
{
Serial.begin(115200);
Serial.println("SparkFun Ublox Example");
Wire.begin();
if (myGPS.begin() == false)
{
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
while (1);
}
}
void loop()
{
myGPS.checkUblox(); //See if new data is available. Process bytes as they come in.
if(nmea.isValid() == true)
{
long latitude_mdeg = nmea.getLatitude();
long longitude_mdeg = nmea.getLongitude();
Serial.print("Latitude (deg): ");
Serial.println(latitude_mdeg / 1000000., 6);
Serial.print("Longitude (deg): ");
Serial.println(longitude_mdeg / 1000000., 6);
}
else
{
Serial.print("No Fix - ");
Serial.print("Num. satellites: ");
Serial.println(nmea.getNumSatellites());
}
delay(250); //Don't pound too hard on the I2C bus
}
//This function gets called from the SparkFun Ublox Arduino Library
//As each NMEA character comes in you can specify what to do with it
//Useful for passing to other libraries like tinyGPS, MicroNMEA, or even
//a buffer, radio, etc.
void SFE_UBLOX_GPS::processNMEA(char incoming)
{
//Take the incoming char from the Ublox I2C port and pass it on to the MicroNMEA lib
//for sentence cracking
nmea.process(incoming);
}
Any help would be appreciated