Chat freely about anything...

User avatar
By QuickFix
#69298 A had a very pleasant surprise today: while I was searching through my boxes of electronic components, I stumbled accross a NEO-6 GPS module. :D
So it was pretty easy, to try things out and this is what I came up with.

Since the ESP-01 has GPIO2 attached to a pin, you can use Serial1 for logging/passing through the GPS messages.
Here's the test code I used:
Code: Select allvoid setup() {
  Serial1.begin(115200);

  Serial1.println("Starting UART for GPS module at 9600 Baud");
  Serial.begin(9600);

  Serial1.println("Starting sketch");
}

void loop() {
  size_t len = Serial.available();
  if (len > 0) {   
    uint8_t sbuf[len];
    Serial.readBytes(sbuf, len);
     
    Serial1.write(sbuf, len);
  }
}
Note that serial1 is used to listen to our ESP and the baud rate is set at 115200 (though you can choose any baudrate you want), whilst Serial (which is connected to the GPS module) is set to 9600Baud (it has to be 9600, since that's the speed the GPS module sends it's data at).

Image

The hardware isn't really worth drawing a sketch for; just connect all power lines to +3.3V and GND and
  • TX of GPS module to RX of ESP-01
  • GPIO2 of ESP-01 to (USB to) serial of PC