79396535

Date: 2025-01-29 11:19:04
Score: 1
Natty:
Report link

Your code really isn't complete enough for anyone to fully help you.

You seem to have shunted off the code trying to do real work (which is also incomplete) with some code that should just show what you're receiving from the GPS. Are you receiving NMEA sentences displayed in that first loop? They will start with a dollar sign followed by GP, be in all caps, and look like $GPGGA, ... bunch of stuff separated by commas. You should be able to see these even from a PC in a terminal program - the GPS just coughs up this data once a second whether anyone is listening or not.

If you're not seeing that, then your problems are logical or electrical. If you have rx connected to tx and tx to rx, the idle voltage on both pins will be about the same. If they're not, you may have the rx and tx pins swapped. Remember, you'll need a ground between them.

If the voltages match and you're seeing nothing, see if you have the speed argument to the serial system set to match what's expected by the GPS. This is typically 9600 for a GPS but the default speed for Arduino's Serial layer is much faster. https://docs.arduino.cc/language-reference/en/functions/communication/serial/begin/ See if a Serial.begin(9600); at the top before you do serial stuff inside loop() helps.

Double check that the Serial1, Serial2, etc. node that you're using matches what the chip is using. Especially on the models with built-in serial ports on the USB or on boards with external hardware UART, the ordering can be influenced. Transmit a test pattern on the tx corresponding with the port you're listening on. Do you see those letters if you attach another PC's serial port that's listening as above? You may even be able to see LEDs blinking or voltmeters moving at 9600bps: that character time is slow enoughyou can often really SEE the characters on the wire.

A protocol analyzer (even a $7 cheapo) can tell you which pin the data is on as well as the speed and other traits. That's the fail-safe way to see if the GPS isn't putting it on the wire or the other side isn't taking it off. Add that neutral third party to see what's REALLY on the wire and where.

Please upvote helpful and correct answers. Being able to only help two people an hour becuase answers are rate limited really limits the number of contributors that these niche corners of SO can get.

Reasons:
  • Blacklisted phrase (0.5): upvote
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Robert L