ESP32 with Neo M8N TinyGPS++

Hi everyone!

Im using an ESP32 with a Neo M8N GPS and the TinyGPS++ library.
When I connect my NEO M8N via USB to u-centre, u-centre reports ~10 GPS satellites, and a further 9 or so BeiDou satellites, for a total of ~19 satellites.

However when the M8N is connect to the ESP32 (and the tiny GPS++ library) , gps.satellites.value() will only ever report/phrase a max of 12 satellites.

How exactly do I get tinyGPS++ to calculate all the satellites that u-center sees?

Ideally Id like tinyGPS++ to:

1/ Report the (real) total number of satellites.
2/ Report the number of GPS satellites.
3/ Report the number of BeiDou satellites.
4/ Report the 2D accuracy in meters.
5/ Report the heading in deg.

Ive had a look at TinyGPS++ : UsingCustomFields can extract custom
fields from any NMEA sentence.

https://codebender.cc/example/TinyGPS++/UsingCustomFields#UsingCustomFields.ino

But dont understand How to convert the M8N output to NMEA, and what tinyGPS++ custom fields I need for 1-5 (above^^)

Here is my code (forgive me, its a real hack)


#include <Wire.h>
#include <TinyGPS++.h>
#include <SPI.h>
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();


#define RXD2 16
#define TXD2 17
HardwareSerial neogps(1);

TinyGPSPlus gps;

void setup() {
      tft.init();
      tft.setRotation(1);
  Serial.begin(115200);
  //Begin serial communication Arduino IDE (Serial Monitor)

  //Begin serial communication Neo6mGPS
  neogps.begin(9600, SERIAL_8N1, RXD2, TXD2);
  

  }


void loop() {


    
  boolean newData = false;
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (neogps.available())
    {
      if (gps.encode(neogps.read()))
      {
        newData = true;
      }
    }
  }

  //If newData is true
  if(newData == true)
  {
    newData = false;




    
   tft.fillScreen(TFT_BLACK);


  tft.setTextColor(TFT_WHITE, TFT_BLACK);
  tft.setCursor(2, 2, 4);
   tft.print("Knots ");
    tft.setCursor(85, 2, 4);
   tft.print(gps.speed.kmph()) / 1.852;

   
 tft.setCursor(175, 2, 4);
  tft.setTextColor(TFT_WHITE, TFT_BLACK);
  tft.print("Satellites ");
  tft.setCursor(283, 2, 4);
  tft.print(gps.satellites.value());
  

   
  tft.setTextColor(TFT_WHITE, TFT_BLACK);
  tft.setCursor(2, 42, 4);
   tft.print("Longitude ");
    tft.setCursor(25, 80, 6);
  tft.print(gps.location.lng(),5);

 tft.setTextColor(TFT_WHITE, TFT_BLACK);
  tft.setCursor(2, 143, 4);
   tft.print("Latitude  ");
    tft.setCursor(25, 180, 6);
  tft.print(gps.location.lat(),5);


    Serial.print("Satellites ");
    Serial.println(gps.satellites.value());
    Serial.print("Lat ");
    Serial.println(gps.location.lat(),5);
        Serial.print("Lng ");
    Serial.println(gps.location.lng(),5);
    Serial.print("Speed KMPH ");
    Serial.println(gps.speed.kmph());
    //print_speed();
  }
  else
  {


  }  
  
}



Which message type is the number of BeiDou satellites reported in and is it supported by the library ?

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