TTGO T-Beam v1.0 ESP32 with GPS NEO-6M


Does anyone have a example sketch to read GPS coordinates using TTGO T-Beam v1.0 ESP32 with GPS NEO-6M?

thank you

If you go here;

There is in the \examples\Hardware_Checks\ESP32

folder a series of test programs for ESP32, including for a GPS that will display fix information from the GPS, that I used when setting up a small portable TTN Mapper;



This is my board; code is compatible ??

Ah, I was thinking the other TTGOs, should pay more attention …

The program however does have a Settings file which allows the pins the GPS is accessed on to be changed, you would probably need to change the pin allocations to;

#define GPSTX 15 //pin number for TX output from Arduino - RX into GPS
#define GPSRX 12 //pin number for RX input into Arduino - TX from GPS

Reference Arduino/ESP32 sketch from the TTGO T-Beam V1.0 manufacturer:

Sending this code:
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
#include <axp20x.h>

TinyGPSPlus gps;
SoftwareSerial ss(12,34);
AXP20X_Class axp;

//HardwareSerial Serial1(1);

void setup()
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON);

Serial.begin(9600, SERIAL_8N1, 34, 12); //17-TX 18-RX

void loop()

while (ss.available() > 0)

Serial.print("Latitude : ");
Serial.println(, 5);
Serial.print("Longitude : ");
Serial.println(gps.location.lng(), 4);
Serial.print(“Satellites: “);
Serial.print(“Altitude : “);
Serial.print(gps.altitude.feet() / 3.2808);
Serial.print(“Time : “);


if (millis() > 5000 && gps.charsProcessed() < 10)
Serial.println(F(“No GPS data received: check wiring”));

static void smartDelay(unsigned long ms)
unsigned long start = millis();
while (Serial1.available())
} while (millis() - start < ms);


18:38:33.269 -> **********************
18:38:34.253 -> No GPS data received: check wiring
18:38:34.253 -> Latitude : 0.00000
18:38:34.253 -> Longitude : 0.0000
18:38:34.253 -> Satellites: 0
18:38:34.253 -> Altitude : 0.00M
18:38:34.253 -> Time : 0:0:0
18:38:34.253 -> **********************

//no data are shown

Those pins for the GPS dont match what was shown on the picture of the PCB that you posted …

i’m not sure, but according to TTGO T-Beam v1.0 pin out,
TX = IO34;
RX= IO12
it’s incorrect ??

thank you for support

You tell us, the picture you posted of your board says the GPS pins are 12 and 15, take a look.

Sorry for misundestanding; the correct picture is availabra here:

i confirm :slight_smile:
TX = IO34;
RX= IO12;

And the GPS pin label or your real board, the one you actually have, is the same as the new picture ?

And the GPS is outdoors with a good view of the sky ?

This command;

SoftwareSerial ss(12,34);

sets up SoftwareSerial (the ESP32) to receive data on pin 12. That would need to be the TX pin of the GPS.

Can you point us to a description of your TTN mapper (which board, circuit diagram and other information etc.).

I have not published that information as yet.

The board was my own design and build. The software was a straight forward program using TinyLoRa.

Thank you for the information. It would be very nice if you could share your project with us.