1

I have tried contacting the manufacturers as well as many Google searches. I have tried many different libraries to get this GNSS-GPS working.

Libraries I've Tried:

  • Arduino_GPS

  • Arduino_Parser_Ublox_Neo_M8N

  • esp32-ublox

  • MicroNMEA

  • NEO-M8N

  • NeoGPS

  • UBLOX-NEO-M8N

The library I am trying now:

  • Parser_Ublox_Neo_M8N with:
  • ESPSoftwareSerial

(I have a non-AVR board so NeoSWSerial and SoftwareSerial didn't work for me.)

Link to files on GitHub: https://github.com/toskyRocker/Arduino_Parser_Ublox_Neo_M8N

My questions for someone who has done this before with a U-Blox M8N:

  • Must I use U-Center software to configure the gps before it will output data?
  • Does my code look to be functional? I can compile but then when attaching GPS I get the output (as my psuedo error message) that lets me know the serial connection between my TTGO T-Call V1.3 and U-Blox-M8N is not valid. Here is a link to the board I have and the GNSS-GPS:

Board: https://www.ebay.com/i/284030711638?chn=ps&norover=1&mkevt=1&mkrid=711-213727-13078-0&mkcid=2&itemid=284030711638&targetid=4580840328168117&device=c&mktype=&googleloc=&poi=&campaignid=403206339&mkgroupid=1235851284533722&rlsatarget=pla-4580840328168117&abcId=9300372&merchantid=51291&msclkid=52c16af1ba571d52ddfe35755ba68854

GPS: https://www.bidorbuy.co.za/item/319275677/GYGPSV5_NEO_M8N_NEO_M8N_001_GPS_Chip_Module_for_APM2_6_Flight_Control.html

(The "<#include SoftwareSerial.h>" in the code below is what was added when I used the Arduino IDE's drop down libraries menu when I selected espsoftwareserial to include.)

Here is the (.ino) code:

#include <SoftwareSerial.h>

#include "Ublox.h"
#define SERIAL_BAUD 115200
#define GPS_BAUD 9600
#define N_INTS 4
//gpsSerial(3,1);
Ublox M8_Gps;
// Altitude - Latitude - Longitude - N Satellites
int gpsArray[N_INTS] = {0, 0, 0, 0};
SoftwareSerial gpsSerial;

/////////////////////////////////////////////////////////////

void setup() {
Serial.begin(SERIAL_BAUD);
gpsSerial.begin(GPS_BAUD,SWSERIAL_8N1,3,1);
//gpsSerial.begin(GPS_BAUD);
pinMode(0,OUTPUT);
}
///////////////////////////////////////////////////////////
void loop() {
digitalWrite(0,LOW);
if(!gpsSerial.available()){
    Serial.print("Problem with GPS ");
}
while(gpsSerial.available()){
    char c = gpsSerial.read();
     if (M8_Gps.encode(c)) {
      gpsArray[0] = M8_Gps.altitude;
      gpsArray[1] = M8_Gps.latitude;
      gpsArray[2] = M8_Gps.longitude; 
      gpsArray[3] = M8_Gps.sats_in_use;
    }
 }
 for(byte i = 0; i < N_INTS; i++) {
 Serial.print(gpsArray[i], 10);Serial.print(" ");
 }
 Serial.println("");
 }
3
  • 1
    1) By default the GPS module has a baud rate of 115200; 2) ESP32 has more than 1 hardware serial, use Serial2 allows you to operate at 115200 and connect to GPS module.
    – hcheung
    Oct 13 '20 at 1:08
  • Thank you very much for your help. Is serial2 the pins labeld Rx Tx or would that be a different UART pin combo?
    – Jerrad
    Oct 17 '20 at 14:38
  • ESP32 Serail2 is at Pin16 (Rx) and Pin 17 (Tx), see HardwareSerial source code for ESP32.
    – hcheung
    Oct 22 '20 at 0:58
0

Must I use U-Center software to configure the gps before it will output data?

No, but it is HIGHLY recommended. It's the only (easy) way to change the baudrate, and the only (easy) way to change what messages are output over serial.

Does my code look to be functional?

I can't answer 100%, as I have not used that library before, but the problem I did run into with the NEO-M8N and multiple libraries I tried (MicroNMEA, TinyGPS, TinyGPS++, ...) was that as a multi-constellation GNSS receiver that can receive more satellite constellations than just GPS, it by default outputs $GNGGA. These libraries I had tried using only decoded the old standard $GPGGA, and ignored the more universal ones.

Here is how you can use U-Center to verify this is the problem, and if so how to configure your module to output GPGGA messages that these libraries will parse:

  1. Connect to your NEO-M8N using U-center. (Usb is pprefered, but serial will work fine too)
  2. Confirm that this is the problem by clicking View -> Messages View.
  3. You should see either GPGGA or GNGGA messages being received.

If you are currently getting GNGGA, here is how to switch them to GPGGA:

  1. View -> configuration View
  2. Click on "NMEA (NMEA Protocol) config entry
  3. Click "Poll" at the bottom to pull the current settings from your device.
  4. Change the "Main Talker ID" to "1 - GP (GPS)"
  5. Change the "GSV Talker ID" to "1 - Use main talker ID"
  6. Click "Send" at the bottom to upload your changes.
  7. Click on the "CFG (Configuration)" config entry
  8. Choose "Save current configuration" and then "Send" at the bottom.

Now just use the method above to verify what NMEA packets you are receiving!

Now that you're in U-Center, I'd recommend also checking out the GNSS config, to enable the use of more satellites (GPS, Glonass, Galileo) and set the SBAS config depending on your location. (In the US, setting to WAAS may help it lock on quicker as it won't bother searching for other SBAS sources) You can also change the baud rates for different ports under "PORTS", increase or decrease the frequency of sending location updates under "RATE" and enable or disable individual NMEA messages for each port under "MSG"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.