SlashDevin / NeoGPS

NMEA and ublox GPS parser for Arduino, configurable to use as few as 10 bytes of RAM
GNU General Public License v3.0
714 stars 196 forks source link

ESP32 + NeoGPS + Nextion - usage of all hardware serial #77

Closed sashahn closed 6 years ago

sashahn commented 6 years ago

Hi, Newbie here and help needed for ESP32 Arduino core. Done so far:

more details on why to do that can be found on - hackaday.com

The Library was tested with Arduino Mega 2560 and it works like charm, but with ESP32 (Lolin32 board) it has some glitches....Data flow is not consistence, it works but lot of delays appears, not fluid as it was with Mega board.

Thank you and sorry for my bad English

SlashDevin commented 6 years ago

In IDE Serial ports are declared as below:

What do you mean, "In IDE"? Do you mean:

  1. You modified the core files HardwareSerial.h and .cpp? I would suggest using the standard names. In HardwareSerial.h:
    extern HardwareSerial Serial;
    extern HardwareSerial Serial1;
    extern HardwareSerial Serial2;

    ... and in HardwareSerial.cpp:

HardwareSerial Serial(0);
HardwareSerial Serial1(1);
HardwareSerial Serial2(2);

Then use #defines in your sketch to associate a HardwareSerial instance with your specific name:

#define DEBUG_PORT   Serial
#define gpsPort      Serial1
#define DISPLAY_PORT Serial2

          OR do you mean

  1. They are declared in your sketch (.INO)? Don't create new HardwareSerial variables in your sketch. These will be "copies" of variables that were defined in HardwareSerial.cpp. This can cause unexpected behaviour.

Does "GPSport.h" has to be edited too?

Only if you are including GPSport.h in your sketch. If you are declaring your own serial port variables, you do not need this file. GPSport.h is the one file you would change to make all NeoGPS examples use the same serial port configuration(s). No other parts of NeoGPS include this file.