TinyGPS++ is a new Arduino library for parsing NMEA data streams provided by GPS modules. To install this library, download here, unzip the archive into the Arduino “libraries” folder, and restart Arduino. You should rename the folder “TinyGPSPlus”.
The TinyGPS++ connect GPS module using SoftwareSerial. To make it work on ESP32, install EspSoftwareSerial in Arduino IDE Library Manager.
Now you can open TinyGps++ DeviceExample.
Modify the RXPin and TXPin to match with you connection. It's 16 and 17 in my case. And change GPSBaud to 9600.
Verify and Upload to run it.
/* Connection between ESP32 and ATGM336H-5N: ESP32 ATGM336H-5N ----------------------- VCC VCC GND GND 16 (RX) TX 17 (TX) RX */ static const int RXPin = 16, TXPin = 17; static const uint32_t GPSBaud = 9600;