hello;

I just bought a Mediatek 3329 GPS module. i connected my gps to my arduino uno as in;

5V----> 5V

GND--->GND

OUT---->RX

And i'm trying to use the below code:

/*
Example of GPS MTK library.
Code by Jordi Mu�oz and Jose Julio. DIYDrones.com

Works with Ardupilot Mega Hardware (GPS on Serial Port1)
and with standard ATMega168 and ATMega328 on Serial Port 0
*/

#include <GPS_MTK.h> // UBLOX GPS Library

void setup()
{
Serial.begin(38400);
Serial.println("GPS MTK library test");
GPS.Init(); // GPS Initialization
delay(1000);
}
void loop()
{
GPS.Read();
if (GPS.NewData) // New GPS data?
{
Serial.print("GPS:");
Serial.print(" Lat:");
Serial.print(GPS.Lattitude);
Serial.print(" Lon:");
Serial.print(GPS.Longitude);
Serial.print(" Alt:");
Serial.print((float)GPS.Altitude/100.0);
Serial.print(" GSP:");
Serial.print((float)GPS.Ground_Speed/100.0);
Serial.print(" COG:");
Serial.print(GPS.Ground_Course/1000000);
Serial.print(" SAT:");
Serial.print((int)GPS.NumSats);
Serial.print(" FIX:");
Serial.print((int)GPS.Fix);
Serial.print(" TIM:");
Serial.print(GPS.Time);
Serial.println();
GPS.NewData = 0; // We have readed the data
}
delay(20);
}

But after GPS is locked onto satellites, i can not get a data from GPS i only have 

"GPS MTK library test"

What should i have to do?

Can anybody help please

Views: 2068

Reply to This

Replies to This Discussion

Hi Batuhan,

Wait until the led stop blinking, which means gps is locked. then copy below code

 void setup(){
  pinMode(0,INPUT);
  digitalWrite(0,LOW);
  pinMode(1,INPUT);
  digitalWrite(1,LOW);
}

void loop(){
  while(1);
}

compile, upload and click serial monitor.

Hope this helps.

Hi ahmed;

I tried this code but nothing happens. What does this code do?

Even gps is locked or not, code writes to window what it reads from the gps. Are you sure with your connection? I advice you to check connector lines from the pcb pads. with a buzzer. I mean one end to bottom of the gps OUT and other end arduino to the bottom of the arduino Rx.

Since blue led blinking power supply is ok.

I'm pretty sure about my  connection, but i ordered a new cable just to be sure whether there is something wrong with the cable or not.

There is nothing appearing in the serial monitor window.

I was confused you say that it has to print everything it reads from gps but i cannot see any print command in the code you sent me? Am i missing something?

If you "just bought" this unit, you need the library that works with the newer firmware GPS. GPS_MTK.h is at least a year old, and speaks to the old GPS firmware.

I believe the correct name is AP_GPS_MTK16.h and AP_GPS_MTK16.cpp

You will have to alter the code to force the library to read from serial0 ("serial") instead of Serial1.

If the new software has too many dependencies for you, you could scoop out the guts of the new parser and put it into the old.

*

Ignore ahmed's code. It does next to nothing, and completely nothing regarding reading / writing any data out the ports. In fact he screws up your serial TX by making it an input.

Hi Ken!

thanks for the advice!

i have the same problem... and modifying the following files for the library AP_GPS and the arduino test file:

1) GPT_MTK_test.pde line 16:

AP_GPS_MTK gps(&Serial1); ==> AP_GPS_MTK16 gps(&Serial1);

2) AP_GPS_Auto.cpp line 155:

gps = new AP_GPS_MTK(_port); ==> gps = new AP_GPS_MTK16(_port);

my GPS works fine!!

PD1: ah!! i have the problem testing my GPS on the APM board... i suppose this method workś on Arduino Uno too

PD2: sorry for my english, my mother language is spanish.

HI GUys any of you get the GPS to work with Uno correctly?

Yes. Gps working quite well.

thats awesome , you mind sharing your code please . i cant get it working form the post

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service