Integrating ZED F9P GNSS module with esp32 s3 mini1

hii, i am connecting ZED F9P GNSS module with ESP32 s3 mini1 . i have done the programing for it . But its giving me raw output (Location ).Below program for GNSS i have used #include <SparkFun_u-blox_GNSS_v3.h>
#include <HardwareSerial.h>

// Create HardwareSerial instance on UART1 for the GNSS module
HardwareSerial mySerial(1); // Using UART1
SFE_UBLOX_GNSS myGNSS;

void setup() {
Serial.begin(115200); // For Serial Monitor
delay(1000); // Allow time for the serial monitor to initialize

// Configure UART2 with GPIO17 (RX) and GPIO18 (TX) for GNSS communication
mySerial.begin(9600, SERIAL_8N1, 17, 18);

Serial.println(“Initializing GNSS module…”);

if (!myGNSS.begin(mySerial)) {
Serial.println(“GNSS initialized successfully.”);
} else {
Serial.println(“Failed to initialize GNSS!”);
return;
}

// Configure GNSS settings if required (optional)
myGNSS.setNavigationFrequency(1); // 1Hz update rate
Serial.println(“GNSS configuration complete.”);
}

void loop() {
// Check GNSS Fix Type
uint8_t fixType = myGNSS.getFixType();
uint8_t satellites = myGNSS.getSIV(); // Satellites in view

// Print Fix Type and Satellite Info for debugging
Serial.print("Fix Type: ");
Serial.println(fixType);
Serial.print("Satellites in View: ");
Serial.println(satellites);

// Check if the GNSS has a valid fix
if (fixType >= 3) { // Fix Type 3: 2D or 3D Fix
Serial.println(“Valid GPS Fix Detected!”);

// Retrieve and print Latitude, Longitude, and Altitude
float latitude = myGNSS.getLatitude() / 1e7;  // Convert to decimal degrees
float longitude = myGNSS.getLongitude() / 1e7;
float altitude = myGNSS.getAltitude() / 1000.0; // Convert to meters

Serial.print("Latitude: ");
Serial.println(latitude, 7);
Serial.print("Longitude: ");
Serial.println(longitude, 7);
Serial.print("Altitude: ");
Serial.print(altitude, 2);
Serial.println(" m");

} else {
Serial.println(“No valid GPS fix yet. Please ensure the module is in open sky.”);
}

// Wait 10 seconds before rechecking
delay(10000);
} In u centre software its giving me raw NMEA data but not getting NMEA data through programming . plz guide me .

Not really sure what you’re doing, but isn’t the default baud rate 38400, and NOT 9600 ?

Hi @Shweta8888 ,

You should be using the SFE_UBLOX_GNSS_SERIAL class, not SFE_UBLOX_GNSS.

Also, the delay(10000) will cause the serial data to stall / overflow.

I recommend using our examples and make as few changes as possible. The Example5_CustomSerial example is a good place to start.

I hope this helps,
Paul

I have tried with different baudrate , still ts not working

Not really explaining the issue.

Isn’t GPIO17 U1TXD?

Please explain or diagram exactly what you’ve built, showing boards and wiring. Grounds common?

Perhaps code a more simple UART forwarder where the output of the ZED-F9P is sent to Serial directly and not reprocessed. Can you see the NMEA data then?

i am using GPIO 17 U1 of uc to tx and GPIO 18 U1 of uc to rx of gnss

Where did you pull the HardwareSerial code example?
Did you try a simple forwarder? I’ll perhaps assume you don’t have a scope or logic analyzer to do basic sanity checking.
I seem to recollect the ESP32-S3-MINI-1 have the defaults for UART1 the other way round, but supposedly the switching fabric is flexible.
Perhaps can you provide a picture of the boards/wiring? Large (high resolution), clear and in-focus would be ideal.

1 Like

Hi @Shweta8888 ,

Please see the post below. Maybe it will help?

Best,
Paul

Ok, I will try

1 Like

I have tried using above code its working

1 Like

I am using 17-Rx and 18 Tx pins of ESP32 s3 mini1 UC connecting with ZED F9P GNSS module. I have tried this with sample code provided by Sparkfun for NMEA data but still not getting data in serial monitor . i have checked in u centre software i am getting the NMEA data . I have tried in outdoor also but still its not working. if anyone can guide me for this problem it will helpful for me. i have provided sample code below
#include <Wire.h> //Needed for I2C to GNSS

#include <SparkFun_u-blox_GNSS_v3.h> //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS_v3
SFE_UBLOX_GNSS myGNSS;

void setup()
{
Serial.begin(115200);
Serial.println(“SparkFun u-blox Example”);

Wire.begin();

if (myGNSS.begin() == false)
{
Serial.println(F(“u-blox GNSS not detected at default I2C address. Please check wiring. Freezing.”));
while (1);
}

myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA); //Set the I2C port to output both NMEA and UBX messages
myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR

//This will pipe all NMEA sentences to the serial port so we can see them
myGNSS.setNMEAOutputPort(Serial);
}

void loop()
{
myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in.

delay(250); //Don’t pound too hard on the I2C bus
}

Hi @Shweta8888 ,

That sample code is for I2C (Qwiic), not Serial / UART…

Best wishes,
Paul

@Shweta8888 : I do not know if this will work - I do not have an S3 mini to test - but please try:

#include <HardwareSerial.h>

#include <Arduino.h>

int8_t tx_pin = 17; // Connect to RX of GNSS (UART1)
int8_t rx_pin = 18; // Connect to TX of GNSS (UART1)

unsigned long baud_rate = 38400;

HardwareSerial mySerial(1); //ESP32 UART1

#include <SparkFun_u-blox_GNSS_v3.h>
SFE_UBLOX_GNSS_SERIAL myGNSS;

void setup()
{
  delay(1000);

  Serial.begin(115200);
  Serial.println("SparkFun u-blox Example");

  mySerial.begin(baud_rate, SERIAL_8N1, rx_pin, tx_pin);

  //myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial

  while (myGNSS.begin(mySerial) == false)
  {
    Serial.println(F("u-blox GNSS not detected. Please check wiring and baud rate."));
  }

  myGNSS.setUART1Output(COM_TYPE_UBX | COM_TYPE_NMEA); //Set the UART1 port to output both NMEA and UBX messages
  myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR

  //This will pipe all NMEA sentences to the serial port so we can see them
  myGNSS.setNMEAOutputPort(Serial);
}

void loop()
{
  myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in.

  delay(250);
}