Bike computer build help - GPS

This is the sequel to Bike computer build help - touchscreen and Bike computer help - using smooth arc in case you're interested.

I'm using an ESP32-S3 that comes as part of a dev kit which includes a 1.28" touchscreen. It can be found here:
https://www.waveshare.com/esp32-s3-touch-lcd-1.28.htm

I'm also using this Ultimate GPS breakout board from Adafruit:
https://learn.adafruit.com/adafruit-ultimate-gps/overview

I was following the tutorial on Adafruit which says to hook up the board to a microprocessor and load in a blank sketch. I was eventually able to get this working with an Arduino Nano Every so I know the GPS board is working.

When I connect it to the ESP32 and I run the Example GPS_HardwareSerial_EchoTest.ino, it doesn't have any problems loading up, but also only puts out the following in the Serial Monitor:
ESP-ROM:esp32s3-20210327

Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x38 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbe4
load:0x403cc700,len:0x2a68
entry 0x403c98d4

After some googling, I changed Serial1 to Serial2 in line 19 and I got the same thing except there was a strange ? character at the end.

If I load the GPS_SoftwareSerial_EchoTest.ino, and put the appropriate pins into the code, I get:
No such file or directory SoftwareSerial.h, even though it's there. So I copied the file to like every library folder that was remotely connected to Arduino, including pasting the code into a new tab and changing #include <SoftwareSerial.h> to #include "SoftwareSerial.h". Then I got a whole bunch of very long errors, I can include if you want.

Any idea how to get the data out of this thing?

Show the code you are using and the errors in your next post. Include a wiring diagram.

You did connect GPS TX and ESP RX to each other, and vice versa? I would hate to be the first person who made that mistake.

Yes, I did connect Tx>Rx. Thank you.

Here's the code for the HardwareSerial. It's not my code, though. It's the example:

// Test code for Ultimate GPS Using Hardware Serial
// (e.g. GPS for Leonardo, Flora or FeatherWing)
//
// This code shows how to test a passthru between USB and hardware serial
//
// Tested and works great with the Adafruit GPS FeatherWing
// ------> https://www.adafruit.com/products/3133
// or Flora GPS
// ------> https://www.adafruit.com/products/1059
// but also works with the shield, breakout
// ------> https://www.adafruit.com/products/1272
// ------> https://www.adafruit.com/products/746
//
// Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada


// what's the name of the hardware serial port?
#define GPSSerial Serial2


void setup() {
  // make this baud rate fast enough to we aren't waiting on it
  Serial.begin(115200);

  // wait for hardware serial to appear
  while (!Serial) delay(10);

  // 9600 baud is the default rate for the Ultimate GPS
  GPSSerial.begin(9600);
}


void loop() {
  if (Serial.available()) {
    char c = Serial.read();
    GPSSerial.write(c);
  }
  if (GPSSerial.available()) {
    char c = GPSSerial.read();
    Serial.write(c);
  }
}

There error is above.

Here's the code for the SoftwareSerial, again, not my code except that I changed the pin assignment to match mine. I am using GPIO16.

// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
//
// This code just echos whatever is coming from the GPS unit to the
// serial monitor, handy for debugging!
//
// Tested and works great with the Adafruit Ultimate GPS module
// using MTK33x9 chipset
//    ------> http://www.adafruit.com/products/746
// Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada

#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>

// Connect the GPS Power pin to 5V
// Connect the GPS Ground pin to ground
// Connect the GPS TX (transmit) pin to Digital 8
// Connect the GPS RX (receive) pin to Digital 7

// You can change the pin numbers to match your wiring:
SoftwareSerial mySerial(16, 17);

#define PMTK_SET_NMEA_UPDATE_1HZ  "$PMTK220,1000*1F"
#define PMTK_SET_NMEA_UPDATE_5HZ  "$PMTK220,200*2C"
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F"

// turn on only the second sentence (GPRMC)
#define PMTK_SET_NMEA_OUTPUT_RMCONLY "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29"
// turn on GPRMC and GGA
#define PMTK_SET_NMEA_OUTPUT_RMCGGA "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28"
// turn on ALL THE DATA
#define PMTK_SET_NMEA_OUTPUT_ALLDATA "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28"
// turn off output
#define PMTK_SET_NMEA_OUTPUT_OFF "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28"

#define PMTK_Q_RELEASE "$PMTK605*31"

void setup() {
  while (!Serial); // wait for Serial to be ready

  Serial.begin(115200); // The serial port for the Arduino IDE port output
  mySerial.begin(9600);
  delay(2000);

  Serial.println("Software Serial GPS Test Echo Test");
  // you can send various commands to get it started
  //mySerial.println(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  mySerial.println(PMTK_SET_NMEA_OUTPUT_ALLDATA);

  mySerial.println(PMTK_SET_NMEA_UPDATE_1HZ);

  Serial.println("Get version!");
  mySerial.println(PMTK_Q_RELEASE);
 }


void loop() {
  if (Serial.available()) {
   char c = Serial.read();
   Serial.write(c);
   mySerial.write(c);
  }
  if (mySerial.available()) {
    char c = mySerial.read();
    Serial.write(c);
  }
}

Here is the error I get with the SoftwareSerial example with #include <SoftwareSerial.h>:

C:\Users\ozone\AppData\Local\Temp\.arduinoIDE-unsaved20241112-12252-r614x9.qjyq\GPS_SoftwareSerial_EchoTest\GPS_SoftwareSerial_EchoTest.ino:13:10: fatal error: SoftwareSerial.h: No such file or directory
 #include <SoftwareSerial.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: SoftwareSerial.h: No such file or directorytype or paste code here

Here is the error I get with the SoftwareSerial example using "SoftwareSerial.h"

c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o:(.literal._Z5setupv+0x2c): undefined reference to `SoftwareSerial::begin(long)'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o:(.literal.startup._GLOBAL__sub_I_mySerial+0x0): undefined reference to `SoftwareSerial::SoftwareSerial(unsigned char, unsigned char, bool)'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o:(.literal.exit._GLOBAL__sub_D_mySerial+0x0): undefined reference to `SoftwareSerial::~SoftwareSerial()'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o:(.literal._Z4loopv+0x0): undefined reference to `SoftwareSerial::write(unsigned char)'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o:(.literal._Z4loopv+0x4): undefined reference to `SoftwareSerial::available()'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o:(.literal._Z4loopv+0x8): undefined reference to `SoftwareSerial::read()'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o: in function `setup()':
C:\Users\ozone\AppData\Local\Temp\.arduinoIDE-unsaved20241112-12252-r614x9.qjyq\GPS_SoftwareSerial_EchoTest/GPS_SoftwareSerial_EchoTest.ino:42: undefined reference to `SoftwareSerial::begin(long)'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o: in function `_GLOBAL__sub_I_mySerial':
C:\Users\ozone\AppData\Local\Temp\.arduinoIDE-unsaved20241112-12252-r614x9.qjyq\GPS_SoftwareSerial_EchoTest/GPS_SoftwareSerial_EchoTest.ino:52: undefined reference to `SoftwareSerial::SoftwareSerial(unsigned char, unsigned char, bool)'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o: in function `_GLOBAL__sub_D_mySerial':
C:\Users\ozone\AppData\Local\Temp\.arduinoIDE-unsaved20241112-12252-r614x9.qjyq\GPS_SoftwareSerial_EchoTest/GPS_SoftwareSerial_EchoTest.ino:21: undefined reference to `SoftwareSerial::~SoftwareSerial()'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o: in function `HardwareSerial::write(int)':
C:\Users\ozone\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.12\cores\esp32/HardwareSerial.h:153: undefined reference to `SoftwareSerial::write(unsigned char)'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\arduino\sketches\A57EFE9B94D9785EC48DE4B93838FEBB\sketch\GPS_SoftwareSerial_EchoTest.ino.cpp.o: in function `loop()':
C:\Users\ozone\AppData\Local\Temp\.arduinoIDE-unsaved20241112-12252-r614x9.qjyq\GPS_SoftwareSerial_EchoTest/GPS_SoftwareSerial_EchoTest.ino:61: undefined reference to `SoftwareSerial::available()'
c:/users/ozone/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\ozone\AppData\Local\Temp\.arduinoIDE-unsaved20241112-12252-r614x9.qjyq\GPS_SoftwareSerial_EchoTest/GPS_SoftwareSerial_EchoTest.ino:63: undefined reference to `SoftwareSerial::read()'
collect2.exe: error: ld returned 1 exit status

Using library Adafruit GPS Library at version 1.7.5 in folder: C:\Users\ozone\Documents\Arduino\libraries\Adafruit_GPS_Library 
Using library SPI at version 2.0.0 in folder: C:\Users\ozone\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.12\libraries\SPI 
Using library Wire at version 2.0.0 in folder: C:\Users\ozone\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.12\libraries\Wire 
exit status 1

Compilation error: exit status 1

Here is the schematic. The blue line shouldn't come into play. It's for later, but it IS connected.

Try updating the libraries you are using... or the problem might be the libraries need to be downgraded/backdated. Does the sketch or the origin of the sketch have a date of origin?

Does the ESP32 forum have answers about ESP32 code? ESP32 Forum - Discussion Forum

I backed up the libraries one version at a time until I got to one that just wouldn't load. The result was the same for each.

I got this, and only needed to install the Adafruit GFX library... SoftwareSerial is part of the IDE installation. Maybe you renamed it or added a "softwareserial.h" (lower case). I would restart your IDE, then restart your computer, then search for the file or files.

Software Serial GPS Test Echo Test
Get version!

@xfpd I don't understand your response. I didn't write any of the code, so I didn't rename anything. Are you referring to when I created a new tab and dropped the code into it? Like maybe I didn't name the file with capital letters where appropriate? Also, did you mean install the Adafruit_GPS library instead of the Adafruit_GFX library because it doesn't appear to use the Adafruit_GFX library. Actually, it wouldn't matter since I actually have them both installed. Finally, you said you got:

Software Serial GPS Test Echo Test
Get version!

But after that you should have started receiving a long continuous string of GPS data.

The "collect2.exe" is known here (but I forgot the solution), so I would ask @ptillisch to guide you through that discovery.

I am not using GPS or serial communications to the device. The sketch works when I give it fake communications.

I understand. Perhaps one of the dependencies is calling for SoftwareSerial.h locally (in quotes not LT/GT). ESP32 has been doing upgrades... maybe something more was "upgraded" and needs to be returned to a better version.

What I get from this is; my "fresh" system only needed one library file and the compiler had no problems. If I connected a GPS and serial comms, I would be done. Your question is: What is the difference between your configuration and mine?

[edit] My search for "collect2.exe" solutions seems to indicate re-installing something that is causing the issue, which seem to be a library... and if I had to guess, that would be SoftwareSerial.

Man, I hate to be dense here, but I'm even more confused now. I looked up collect2.exe but I don't really understand it or why you mentioned it. Was it in my error message? Looked through that, but it's really long. I could have missed something.

Which sketch are you using? The hardware sketch compiles just fine for me and uploads. Like you I expected it to work just fine, but nope. It spits out a little info, but not the long string of GPS data I saw when I verified the GPS module was working using an arduino Nano Every.

With the Software one, I just get errors "No such file or directory." When I create a tab with the SoftwareSerial.h file content and change to quotations, I get the huge error that can seen above.

I have actually rebooted the computer once yesterday when Windows did an update and I've restarted the IDE many times, as it is prone to crashing.

And to sound really stupid, I don't know how I would reinstall SoftwareSerial.h. Do you mean reinstall the entire IDE?

EDIT [I have since found out that SoftwareSerial has to be written for your specific board type, which may explain why pasting the code into a new tab and referencing it, didn't work.]

Then why are you using SoftwareSerial ?

The ESP32S3 has spare hardware serial ports that you can allocate to most all of the available IO pins.

Hardware serial is more reliable than SoftwareSerial.

: )

Yes, you will find it eighth line from the bottom of your error log.

You are fine. I just think you are not following the directions from the project you are following.

You can not successfully compile with this error... so saying the sketch you posted "compiled" is not correct. Again, something is missing.

A device like that should be (probably is) ready to roll. Start fresh.

Remove all software. Don't skip or rush the un-install or you will be here again. You might think this is not the right path, but if you want to make it right, you must do it right. "No one has time for the first try, but everyone has time for the second (et c.)." I have had people "start from scratch" on three hour projects multiple times, because one missed step or lapse of attention makes it 100% bad, and I insisted they know how to get it 100% right on their own. They learned very much. So will you.

Because I don't know what I'm doing!

When I downloaded the library, I combed through the document to see if it had hardware serial ports and didn't see it mentioned. Where did you look to find that and if you would please, how do you use them?

EDIT [This was actually a response to post #15. I guess #16 got in between.]

You would be able to post in the "I'm so old..." topic.

I searched "esp32-s3 hardware serial"
oops wrong board ESP32 Hardware Serial2 Example | Circuits4you.com

https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/get-started/establish-serial-connection.html

s

@xfpd Yup, actually read that section you linked to. Might as well be in Russian.

In the pinout you show, I'm guessing it's the grey ones. In which case GPIO16, the one I'm using is correct, but the other document regarding how to set up a serial port didn't work for me. This is how I did it, using the example sketch. I assume I didn't do it right, since it did not spit out data.

// Test code for Ultimate GPS Using Hardware Serial
// (e.g. GPS for Leonardo, Flora or FeatherWing)
//
// This code shows how to test a passthru between USB and hardware serial
//
// Tested and works great with the Adafruit GPS FeatherWing
// ------> https://www.adafruit.com/products/3133
// or Flora GPS
// ------> https://www.adafruit.com/products/1059
// but also works with the shield, breakout
// ------> https://www.adafruit.com/products/1272
// ------> https://www.adafruit.com/products/746
//
// Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada


// what's the name of the hardware serial port?
#define GPSSerial Serial2


void setup() {
  // make this baud rate fast enough to we aren't waiting on it
  Serial.begin(115200);

  // wait for hardware serial to appear
  while (!Serial) delay(10);

  // 9600 baud is the default rate for the Ultimate GPS
  GPSSerial.begin(9600,SERIAL_8N1, 17, 16);
}


void loop() {
  if (Serial.available()) {
    char c = Serial.read();
    GPSSerial.write(c);
  }
  if (GPSSerial.available()) {
    char c = GPSSerial.read();
    Serial.write(c);
  }
}