Go Down

Topic: Arduino Due serial problem with GPS (Read 4210 times) previous topic - next topic

blackst0ne0ne

Hi folks,

I have recently bought an Arduino Due. I would like to output raw GPS data (NMEA sentences) on the Serial monitor, but it outputs garbage in the Serial Monitor (45,23,85,34,...). The code used looks like that:

Code: [Select]

void setup()
{
  Serial3.begin(9600);
  Serial.begin(9600);
}

void loop()
{
  while(Serial3.available())
  {
    Serial.println(Serial3.read());
  }
}


This code worked on my Arduino Mega, but doesn't work on the Due.
The creepy thing is that processed data with TinyGPS works on the Due and shows latitude etc. on the Serial Monitor, but raw GPS data seems being untouchable on the Due.


Any idea?

el_supremo

Try Serial.write instead of println.

Pete
Don't send me technical questions via Private Message.

MarkT

read() returns int, you'll have to cast to char to make it a character.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

pistolero992000

Hi,

I have Skylab  SKM53 Gps module working perfectly, almost out of the box, with my arduino due.

I've connected the GPS Rx pin to Tx1 on the Due and the GPS Tx pin to the Rx1 on the due.... Serial1.begin(9600).... and it's done...

Be aware that if you are indoor, the gps may take as long as it takes to show data (maybe more than two hours)... so try it outdoors and you'll begin receiving data in a few minutes after the gps knows where it is..

Try TinyGps++ or TinyGps13 library !!

http://arduiniana.org/2013/09/greater-accuracy-with-tinygps-13/

Good luck and merry Christmas!!!

blackst0ne0ne

Thank you very much!

It works with Serial.write(), and I also tried TinyGPSPlus. It's just amazing! ]:D

VikasReddy

How did you use tinygps library in Due.Because Tinygps uses softwareserial.h which is not recommended for Due

ard_newbie

#6
Mar 19, 2018, 05:24 pm Last Edit: Mar 19, 2018, 05:25 pm by ard_newbie
What prevents you from replacing software serial by e.g. Serial1  ?

-dev

... or using NeoGPS?  It.s smaller, faster, more accurate and more reliable than all other GPS libraries.  Many other libraries' examples are not structured properly, and they break when you modify them.  Even if you don't use it, be sure to read the Installation section on Choosing a Serial Port.  This can really help your sketch work more reliably.

All the NeoGPS examples will work on the Due, without modification.  They expect the GPS to be on Serial1.

NeoGPS is also available from the Arduino Library Manager, under the menu Sketch-> Include Library-> Manage Libraries.
Really, I used to be /dev.  :(

Go Up