sidwarkd / gp20u7_arduino

A simple Arduino library for the GP20U7 GPS unit
4 stars 5 forks source link

GPS parsing not working using gp20u7_adruino library. #1

Closed SureshG02 closed 6 years ago

SureshG02 commented 6 years ago

Hi , I am using this library for parsing GPS data but it's not working. I am using GP-20U7 GPS and Adruino M0. I waited around 5 mins after upload but still I couldn't see any data in sketch monitor. Any idea about this issue ?

Regards, Suresh

sidwarkd commented 6 years ago

Hey Suresh, thanks for using the library and reaching out. I don't have an M0 to test on but I found the following in the M0 docs.

Note that on the M0, the SerialUSB class refers to USB (CDC) communication; for serial on pins 0 and 1, use the Serial5 class.

If you are using the example code there is the following line:

GP20U7 gps = GP20U7(Serial);

Did you try changing that line to be:

GP20U7 gps = GP20U7(Serial5);
SureshG02 commented 6 years ago

Hello , Thanks for your quick reply. Well I don't think so there is anything like Serial5 class. I could see only SerialUSB, Serial, Serial1, Serial2 and Serial3. Out of this I have my GPS RX connected on Serial port D0/RX pin on board. So I think GP20U7 gps = GP20U7(Serial); is correct only.

Regards, Suresh

On Tue, Jan 16, 2018 at 8:50 PM, Kevin Sidwar notifications@github.com wrote:

Hey Suresh, thanks for using the library and reaching out. I don't have an M0 to test on but I found the following in the M0 docs.

Note that on the M0, the SerialUSB class refers to USB (CDC) communication; for serial on pins 0 and 1, use the Serial5 class.

If you are using the example code there is the following line:

GP20U7 gps = GP20U7(Serial);

Did you try changing that line to be:

GP20U7 gps = GP20U7(Serial5);

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sidwarkd/gp20u7_arduino/issues/1#issuecomment-358065620, or mute the thread https://github.com/notifications/unsubscribe-auth/Afqu3KPVyjcj8mSoZHE4jcA95qV6gTWcks5tLO9ogaJpZM4RgPDG .

SureshG02 commented 6 years ago

Below is updated code I am trying on Arduino M0. Just in additional basically I am using Sodaq Explorer board but this board is made on Arduino M0 platform only with some additional feature.

include

// initialize the library with the serial port to which the device is // connected GP20U7 gps = GP20U7(Serial);

// Set up a Geolocation variable to track your current Location Geolocation currentLocation;

void setup() { // Start the GPS module gps.begin(); }

void loop() { // The call to read() checks for new location information and returns 1 // if new data is available and 0 if it isn't. It should be called // repeatedly. if(gps.read()){ currentLocation = gps.getGeolocation(); SerialUSB.println("Your current location is:"); SerialUSB.print(" Latitude: "); SerialUSB.println(currentLocation.latitude,5); SerialUSB.print(" Longitude: "); SerialUSB.println(currentLocation.longitude,5); } }

SureshG02 commented 6 years ago

Hi Thanks same code worked now. I don't remember what I did before but it worked now. Thanks really good library and very simple code to understand and use.