Firebeetle esp32 with GPS M8N won't communicate with each other

Hi,

I am trying to work with these two modules and i am not able to make the esp32 receive any valid

gps data, at all. The code i run:

#include <TinyGPS++.h>
#include <HardwareSerial.h>

static const int RXPin = 25, TXPin = 26;
static const uint32_t GPSBaud = 9600;


TinyGPSPlus gps;

HardwareSerial GPSSerial(2);

void setup()
{
  Serial.begin(9600);
  GPSSerial.begin(GPSBaud, SERIAL_8N1, RXPin, TXPin);

 
}

void loop()
{
  while (GPSSerial.available() > 0)
    if (gps.encode(GPSSerial.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Date "));
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print(F("/"));
    Serial.print(gps.date.day());
    Serial.print(F("/"));
    Serial.print(gps.date.year());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  
  Serial.println();
}

.And the output:

20:41:39.448 -> Location: INVALID  Date 0/0/2000
20:41:39.495 -> Location: INVALID  Date 0/0/2000
20:41:40.218 -> Location: INVALID  Date 0/0/2000
20:41:40.251 -> Location: INVALID  Date 0/0/2000
20:41:40.298 -> Location: INVALID  Date 0/0/2000
20:41:40.343 -> Location: INVALID  Date 0/0/2000
20:41:40.384 -> Location: INVALID  Date 0/0/2000
20:41:40.417 -> Location: INVALID  Date 0/0/2000
20:41:40.451 -> Location: INVALID  Date 0/0/2000

...

From the pinout of the board i can see that the only default uart pins are IO1, IO3, which is the usual UART0 and cannot directly be used for serial communication.

(Note that this is the Firebeetle 1st revision and not the 2nd one, that is available on DFRobot's website)

The first thing i suspect, is that i got the serial communication wrong and there is something i am missing. Maybe some restricted pins, or lack of UART.

Also, here are the specs of the GPS module according to the retailer.

  • GPS Chip parameters:
  • Receiver type 72-channel u-blox M8 engine
  • GPS/QZSS L1 C/A, GLONASS L10F, BeiDou B1
  • SBAS L1 C/A: WAAS, EGNOS, MSAS
  • Galileo-ready E1B/C (NEO-M8N)
  • Nav. update rate1 Single GNSS: up to 18 HZ
  • Concurrent GNSS: up to 10 Hz
  • Position accuracy2 2.0 m CEP
  • Acquisition2 Cold starts: 26 s
  • Aided starts: 2 s
  • Reacquisition: 1.5 s
  • Sensitivity2 Tracking & Nav: –167 dBm
  • Cold starts: –148 dBm
  • Hot starts: –156 dBm
  • Assistance AssistNow GNSS Online
  • AssistNow GNSS Offline (up to 35 days)3
  • AssistNow Autonomous (up to 6 days)
  • OMA SUPL & 3GPP compliant
  • Oscillator TCXO (NEO-M8N/Q),
  • Crystal (NEO-M8M)
  • RTC crystal Built-In
  • Noise figure On-chip LNA (NEO-M8M). Extra LNA for
  • lowest noise figure (NEO-M8N/Q)
  • Anti jamming Active CW detection and removal. Extra
  • onboard SAW band pass filter (NEO-M8N/Q)
  • Memory ROM (NEO-M8M/Q) or Flash (NEO-M8N)
  • Supported antennas Active and passive
  • Odometer Travelled distance
  • Data-logger For position, velocity, and time (NEO-M8N)
  • Operating temp. –40° C to 85° C
  • Storage temp. –40° C to 85° C (NEO-M8N/Q)
  • 40° C to 105° C (NEO-M8M)
  • RoHS compliant (lead-free)
  • Qualification according to ISO 16750
  • Manufactured and fully tested in ISO/TS 16949 certified production sites
  • Uses u-blox M8 chips qualified according to AEC-Q100
  • Supply voltage 1.65 V to 3.6 V (NEO-M8M)
  • 2.7 V to 3.6 V (NEO-M8N/Q)
  • Power consumption4 23 mA @ 3.0 V (continuous)
  • 5 mA @ 3.0 V Power Save Mode
  • (1 Hz, GPS mode only)
  • Backup Supply 1.4 to 3.6 V
  • NEO-M8N-0 u-blox M8 Concurrent GNSS LCC Module,
  • TCXO, flash, SAW, LNA,
  • Timepulse Configurable 0.25 Hz to 10 MHz

I am powering the module with a 18650 3.6 volt battery, using a 15 Ohm resistor, restricting the voltage to about 3.3 Volts which falls in the normal supply voltage range.

I really dont believe the module is faulty, since it searches for satellites just fine and connects to one, every time there is a chance(I can tell by the blinking light next to the antenna, which it signifies the current status).

What do you think?

As requested by aarg, here is roughly a schematic:

Bad. A resistive voltage divider has no output voltage regulation. You did make a good attempt at posting details but you forgot the schematic.

I've updated my post.

As I said, your power supply scheme is a failure.

Hm. So what do you suggest?

What is powering the ESP32 board?

The same 3.7V battery as the GPS Module.

You should connect the Lion battery to a 3.3V stepdown converter, and power the whole circuit from that.

By the way, this illustrates the importance of proper schematics. If you had one, I wouldn't have had to ask you that. I would just look and see.

Even in your words, you did not mention this until now.

Thanks for the advice. Im fairly new to electronics and leniency to that part is greatly appreciated. Anyway, will do and i will get back. Thanks again.

This forum fundamentally exists for learners. So you're in the right place. We do need people to follow the program as far as posting procedures, it has the most positive outcomes.

Ok, i will have that in mind from now on. Could you maybe elaborate on why this way im powering the circuit would affect the outcome, or could be a problem in general?

It would cause the supply voltage to "sag" any time current is drawn. Because the supply current varies with different things like processor burden, the supply voltage would vary. That is not generally a good thing.

Also, it ignores the effect of the difference in battery voltage between fully charged and almost discharged. That is mainly why a regulator is necessary for this.

I suggested a step down converter, which also regulates, instead of a linear regulator because

  1. the voltage difference between battery and load is small
  2. it is more efficient with power than a linear regulator IC.

The resistor causes the "sag" because of its function - a current to voltage converter! The voltage across the resistor increases proportionally to the current, and so subtracts from the load voltage. You expected that, but passed over the fact that the current is variable.

Oh I see! Thank you for your detailed answer. I will look into it.

You are making an incorrect assumption.

The output you have shown, is merly the sketch reporting that the GPS does not have a location fix. It might well be putting out heaps and heaps of data, but without a location fix.

If the GPS was indeed putting out no data at all the sketch should have halted with this message printed out;

"No GPS detected: check wiring."

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.