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
Tags:
Permalink Reply by ahmed ahmet on December 30, 2011 at 2:25pm 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.
Permalink Reply by Batuhan Avcı on January 2, 2012 at 11:21am Hi ahmed;
I tried this code but nothing happens. What does this code do?
Permalink Reply by ahmed ahmet on January 2, 2012 at 1:20pm 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.
Permalink Reply by Batuhan Avcı on January 2, 2012 at 1:29pm 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?
Permalink Reply by Ken on January 9, 2012 at 5:46pm 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.
Permalink Reply by Michael Vicencio on January 13, 2012 at 2:21pm 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.
Permalink Reply by Johann Van Niekerk on March 22, 2012 at 10:52am HI GUys any of you get the GPS to work with Uno correctly?
Permalink Reply by ahmed ahmet on March 23, 2012 at 12:05am
Permalink Reply by Johann Van Niekerk on March 23, 2012 at 10:37pm thats awesome , you mind sharing your code please . i cant get it working form the post
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.671 members
1280 members
8 members
182 members
15 members
© 2013 Created by Chris Anderson.
Powered by
