Issue with GPS Ublox GY-GPS6MU1

I have recently got one of these U-blox from the lovely ebay (China)

http://www.ebay.com.au/itm/ublox-u-blox-NEO-6M-GPS-module-antenna-build-in-eeprom-/130801842102

and behold I am having some issues with it, I think it could be the actual GPS module but still I want to rule out if it is something stupid I have done.

it is a very basic setup 4 pins ( pin 1 ( VCC = 5 volt) pin 2 Tx ,pin 3 Rx pin 4 Ground)

I have tried to use the tiny GPS library with no luck TinyGPS | Arduiniana

I get the sketch loaded and it looks like it connects as it get a green led on the board that looks like it is communicating but I just no values returned.

am I meant to get some kind of data from the GPS data even if it not connected?

I have even tried just the simple sketch to connect to ublox centre to see if I get anything and nothing this is the code from tiny gps that I was trying.

any help would be great.

#include <TinyGPS.h>
#include <SoftwareSerial.h>

unsigned long fix_age;

SoftwareSerial GPS(0,1); // rx = pin 0 tx = pin 1 
TinyGPS gps;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
long lat, lon;
float LAT, LON;

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

void loop(){
  long lat, lon;
  unsigned long fix_age, time, date, speed, course;
  unsigned long chars;
  unsigned short sentences, failed_checksum;

  // retrieves +/- lat/long in 100000ths of a degree
  gps.get_position(&lat, &lon, &fix_age);

  getGPS();
  Serial.print("Latitude : ");
  Serial.print(LAT/100000,7);
  Serial.print(" :: Longitude : ");
  Serial.println(LON/100000,7);
}

void getGPS(){
  bool newdata = false;
  unsigned long start = millis();
  // Every 1 seconds we print an update
  while (millis() - start < 1000)
  {
    if (feedgps ()){
      newdata = true;
    }
  }
  if (newdata)
  {
    gpsdump(gps);
  }
}

bool feedgps(){
  while (GPS.available())
  {
    if (gps.encode(GPS.read()))
      return true;
  }
  return 0;
}

void gpsdump(TinyGPS &gps)
{
  //byte month, day, hour, minute, second, hundredths;
  gps.get_position(&lat, &lon);
  LAT = lat;
  LON = lon;
  {
    feedgps(); // If we don't feed the gps during this long routine, we may drop characters and get checksum errors
  }
}
SoftwareSerial GPS(0,1); // rx = pin 0 tx = pin 1

You can't do software serial on the hardware serial pins.

i have a Arduino mega 2560 and even if i change the rx and tx to any pin say 31 and 33 it still does not change anything

You have an Arduino with 4 hardware serial ports, and yet you still need to use SoftwareSerial? I don't understand.

Have you looked at the documentation for SoftwareSerial? On the Mega, the only pins that can be used are those that support pin change interrupts.

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

to be honest I have not looked at the documentation for SoftwareSerial, I just checked it and you are right once again I told you that I would probably something stupid I did. I will retry it with out the SoftwareSerial and use the analogue ports

I will try it with this code and see how it goes Arduino Playground - GPS

 #include <string.h>
 #include <ctype.h>

 int ledPin = 13;                  // LED test pin
 int rxPin = 0;                    // RX PIN 
 int txPin = 1;                    // TX TX
 int byteGPS=-1;
 char linea[300] = "";
 char comandoGPR[7] = "$GPRMC";
 int cont=0;
 int bien=0;
 int conta=0;
 int indices[13];

 void setup() {
   pinMode(ledPin, OUTPUT);       // Initialize LED pin
   pinMode(rxPin, INPUT);
   pinMode(txPin, OUTPUT);
   Serial.begin(4800);
   for (int i=0;i<300;i++){       // Initialize a buffer for received data
     linea[i]=' ';
   }   
 }

 void loop() {
   digitalWrite(ledPin, HIGH);
   byteGPS=Serial.read();         // Read a byte of the serial port
   if (byteGPS == -1) {           // See if the port is empty yet
     delay(100); 
   } else {
     linea[conta]=byteGPS;        // If there is serial port data, it is put in the buffer
     conta++;                      
     Serial.print(byteGPS, BYTE); 
     if (byteGPS==13){            // If the received byte is = to 13, end of transmission
       digitalWrite(ledPin, LOW); 
       cont=0;
       bien=0;
       for (int i=1;i<7;i++){     // Verifies if the received command starts with $GPR
         if (linea[i]==comandoGPR[i-1]){
           bien++;
         }
       }
       if(bien==6){               // If yes, continue and process the data
         for (int i=0;i<300;i++){
           if (linea[i]==','){    // check for the position of the  "," separator
             indices[cont]=i;
             cont++;
           }
           if (linea[i]=='*'){    // ... and the "*"
             indices[12]=i;
             cont++;
           }
         }
         Serial.println("");      // ... and write to the serial port
         Serial.println("");
         Serial.println("---------------");
         for (int i=0;i<12;i++){
           switch(i){
             case 0 :Serial.print("Time in UTC (HhMmSs): ");break;
             case 1 :Serial.print("Status (A=OK,V=KO): ");break;
             case 2 :Serial.print("Latitude: ");break;
             case 3 :Serial.print("Direction (N/S): ");break;
             case 4 :Serial.print("Longitude: ");break;
             case 5 :Serial.print("Direction (E/W): ");break;
             case 6 :Serial.print("Velocity in knots: ");break;
             case 7 :Serial.print("Heading in degrees: ");break;
             case 8 :Serial.print("Date UTC (DdMmAa): ");break;
             case 9 :Serial.print("Magnetic degrees: ");break;
             case 10 :Serial.print("(E/W): ");break;
             case 11 :Serial.print("Mode: ");break;
             case 12 :Serial.print("Checksum: ");break;
           }
           for (int j=indices[i];j<(indices[i+1]-1);j++){
             Serial.print(linea[j+1]); 
           }
           Serial.println("");
         }
         Serial.println("---------------");
       }
       conta=0;                    // Reset the buffer
       for (int i=0;i<300;i++){    //  
         linea[i]=' ';             
       }                 
     }
   }
 }

okay I have tried the script with out the software serial setup
Pin 1 - VCC - 5v Arduino
Pin 2 - TX - Digital Pin 1 Arduino
Pin 3 - RX - Digital Pin 0 Arduino
Pin 4 - Ground - Ground Arduino

using the following code

#include <string.h>
 #include <ctype.h>

 int ledPin = 13;                  // LED test pin
 int rxPin = 0;                    // RX PIN 
 int txPin = 1;                    // TX TX
 int byteGPS=-1;
 char linea[300] = "";
 char comandoGPR[7] = "$GPRMC";
 int cont=0;
 int bien=0;
 int conta=0;
 int indices[13];

 void setup() {
   pinMode(ledPin, OUTPUT);       // Initialize LED pin
   pinMode(rxPin, INPUT);
   pinMode(txPin, OUTPUT);
   Serial.begin(9600);
   Serial.print("starting");
   for (int i=0;i<300;i++){       // Initialize a buffer for received data
     linea[i]=' ';
   }   
 }

 void loop() {
   digitalWrite(ledPin, HIGH);
   byteGPS=Serial.read();         // Read a byte of the serial port
   if (byteGPS == -1) {           // See if the port is empty yet
     delay(100); 
   } else {
     linea[conta]=byteGPS;        // If there is serial port data, it is put in the buffer
     conta++;                      
     Serial.print(byteGPS); 
     if (byteGPS==13){            // If the received byte is = to 13, end of transmission
       digitalWrite(ledPin, LOW); 
       cont=0;
       bien=0;
       for (int i=1;i<7;i++){     // Verifies if the received command starts with $GPR
         if (linea[i]==comandoGPR[i-1]){
           bien++;
         }
       }
       if(bien==6){               // If yes, continue and process the data
         for (int i=0;i<300;i++){
           if (linea[i]==','){    // check for the position of the  "," separator
             indices[cont]=i;
             cont++;
           }
           if (linea[i]=='*'){    // ... and the "*"
             indices[12]=i;
             cont++;
           }
         }
         Serial.println("");      // ... and write to the serial port
         Serial.println("");
         Serial.println("---------------");
         for (int i=0;i<12;i++){
           switch(i){
             case 0 :Serial.print("Time in UTC (HhMmSs): ");break;
             case 1 :Serial.print("Status (A=OK,V=KO): ");break;
             case 2 :Serial.print("Latitude: ");break;
             case 3 :Serial.print("Direction (N/S): ");break;
             case 4 :Serial.print("Longitude: ");break;
             case 5 :Serial.print("Direction (E/W): ");break;
             case 6 :Serial.print("Velocity in knots: ");break;
             case 7 :Serial.print("Heading in degrees: ");break;
             case 8 :Serial.print("Date UTC (DdMmAa): ");break;
             case 9 :Serial.print("Magnetic degrees: ");break;
             case 10 :Serial.print("(E/W): ");break;
             case 11 :Serial.print("Mode: ");break;
             case 12 :Serial.print("Checksum: ");break;
           }
           for (int j=indices[i];j<(indices[i+1]-1);j++){
             Serial.print(linea[j+1]); 
           }
           Serial.println("");
         }
         Serial.println("---------------");
       }
       conta=0;                    // Reset the buffer
       for (int i=0;i<300;i++){    //  
         linea[i]=' ';             
       }                 
     }
   }
 }

the only thing I get is if I reset set the device.

11±,,,,012851.00,V,N*45
starting

i also forgot to mention that i only get the power on the GPS now not what looks like the transmit green LED

if I move the GPS to pin 52 and 53 and use the software serial try a basic code to see if I can connect to the serial interface of the GPS to via ublox software

http://www.u-blox.com/en/evaluation-tools-a-software/u-center/u-center.html

the Green LED on the GPS what seems to be a transmit start working but I still get nothing from it.

#include <SoftwareSerial.h>

SoftwareSerial gps(53,52); // pin 53 rx pin 52 tx 

char data; 

void setup()

{  

Serial.begin(9600);  

gps.begin(9600);
  Serial.print("strarted");
} 

void loop()

{ 
 // Serial.print("GPS loop");

       if(gps.available() > 0)

       {    

          data = gps.read();    

          Serial.print(data);  

        }

}

Has anyone got any ideas that may help me with this?

[EDIT]... Why are you using SoftwareSerial at all, There are 3 HW serial ports Serial1, Serial2 and Serial3 remove the software serial stuff and where the software serial object is replace it with Serial1,2 or 3.
The Ublox 6 is the one I'm familiar with and that green light is the "Fix" indicator, If it isn't blinking the device has yet to update it's ephemeris and will produce little useful nav or time data without that fix.
There are commandss that can be sent to the GPS receiver for reducing power and keeping the ephemeris current as well and it comes with some instructions as well.
Perhaps you might try the Adafruit GPS or the Mikal Hart TinyGPS libraries and their examples.
You would also do well to read the various wiki articles about GPS as well as the header files for the suggested libraries for any other useful information.
There is a utility for configuring the U-Blox GPS receivers u-centerSetup-6.3.1.0.rar that I found on
Electrodragons wiki page (I bought one form them) that is used for configuring that device, I think as well as determining sats that the receiver can seen and how well, Really interesting BUT:
USE AT YOUR OWN RISK I HAVE SO WAY OF ASSURING APPLICABILITY, RELEVANCE OR PERFORMANCE...
IF YOU BRICK YOUR DEVICE, YOU DO SO AT YOUR OWN PERIL AND DON'T SAY YOU WEREN'T WARNED.
Apart from the above the software if it works with your U-Blox device and it DOES need a specific FTDI driver as I remember it was a CP2102 although I had no issues with 4 F/F jumpers and an FTDI converter and I think it was a CP2102 but I don't remember for sure or if a PL29XX.. was used I do remember it being quite interesting.
It was an interesting look into GPS as a whole.

Bob

u-centerSetup-6.3.1.0.rar (2.87 MB)

bill,

thank you for you assistance, I used the ADAFRUIT documentation and well you were right when I just use the standard serial port with the ublox Centre software I get a fix straight away.

when I change it to use a software serial and try to get a fix through the Arduino mega on pin 2,3 or 52,53 it does not seem to lock in

how do I decode the nema data?

// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
//
// This code turns on the LOCUS built-in datalogger. The datalogger
// turns off when power is lost, so you MUST turn it on every time
// you want to use it!
//
// Tested and works great with the Adafruit Ultimate GPS module
// using MTK33x9 chipset
//    ------> http://www.adafruit.com/products/746
// Pick one up today at the Adafruit electronics shop 
// and help support open source hardware & software! -ada

#include <Adafruit_GPS.h>
#if ARDUINO >= 100
 #include <SoftwareSerial.h>
#else
  // Older Arduino IDE requires NewSoftSerial, download from:
  // http://arduiniana.org/libraries/newsoftserial/
// #include <NewSoftSerial.h>
 // DO NOT install NewSoftSerial if using Arduino 1.0 or later!
#endif

// Connect the GPS Power pin to 5V
// Connect the GPS Ground pin to ground
// If using software serial (sketch example default):
//   Connect the GPS TX (transmit) pin to Digital 3
//   Connect the GPS RX (receive) pin to Digital 2
// If using hardware serial (e.g. Arduino Mega):
//   Connect the GPS TX (transmit) pin to Arduino RX1, RX2 or RX3
//   Connect the GPS RX (receive) pin to matching TX1, TX2 or TX3

// If using software serial, keep these lines enabled
// (you can change the pin numbers to match your wiring):
#if ARDUINO >= 100
  SoftwareSerial mySerial(53, 52);
#else
  NewSoftSerial mySerial(53, 2);
#endif
Adafruit_GPS GPS(&mySerial);
// If using hardware serial (e.g. Arduino Mega), comment
// out the above six lines and enable this line instead:
//Adafruit_GPS GPS(&Serial1);


// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences
#define GPSECHO  false

// this keeps track of whether we're using the interrupt
// off by default!
boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy

void setup()  
{    
  // connect at 115200 so we can read the GPS fast enuf and
  // also spit it out
  Serial.begin(9600);
  Serial.println("Adafruit GPS logging start test!");

  // 9600 NMEA is the default baud rate for MTK - some use 4800
  GPS.begin(9600);
  
  // You can adjust which sentences to have the module emit, below
  // Default is RMC + GGA
  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  // Default is 1 Hz update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);

  // the nice thing about this code is you can have a timer0 interrupt go off
  // every 1 millisecond, and read data from the GPS for you. that makes the
  // loop code a heck of a lot easier!
  useInterrupt(true);

  while (true) {
    Serial.print("Starting logging....");
    if (GPS.LOCUS_StartLogger()) {
      Serial.println(" STARTED!");
      break;
    } else {
      Serial.println(" no response :(");
    }
  }
}



void loop()                     // run over and over again
{
  delay(1000);
   
  if (GPS.LOCUS_ReadStatus()) {
     Serial.print("\n\nLog #"); 
     Serial.print(GPS.LOCUS_serial, DEC);
    if (GPS.LOCUS_type == LOCUS_OVERLAP)
      Serial.print(", Overlap, ");
    else if (GPS.LOCUS_type == LOCUS_FULLSTOP)
      Serial.print(", Full Stop, Logging");
   
    if (GPS.LOCUS_mode & 0x1) Serial.print(" AlwaysLocate");
    if (GPS.LOCUS_mode & 0x2) Serial.print(" FixOnly");
    if (GPS.LOCUS_mode & 0x4) Serial.print(" Normal");
    if (GPS.LOCUS_mode & 0x8) Serial.print(" Interval");
    if (GPS.LOCUS_mode & 0x10) Serial.print(" Distance");
    if (GPS.LOCUS_mode & 0x20) Serial.print(" Speed");
    
    Serial.print(", Content "); Serial.print((int)GPS.LOCUS_config);
    Serial.print(", Interval "); Serial.print((int)GPS.LOCUS_interval);
    Serial.print(" sec, Distance "); Serial.print((int)GPS.LOCUS_distance);
    Serial.print(" m, Speed "); Serial.print((int)GPS.LOCUS_speed);
    Serial.print(" m/s, Status "); 
    if (GPS.LOCUS_status) 
      Serial.print("LOGGING, ");
    else 
      Serial.print("OFF, ");
    Serial.print((int)GPS.LOCUS_records); Serial.print(" Records, ");
    Serial.print((int)GPS.LOCUS_percent); Serial.print("% Used "); 

  }
}

/******************************************************************/
// Interrupt is called once a millisecond, looks for any new GPS data, and stores it
SIGNAL(TIMER0_COMPA_vect) {
  char c = GPS.read();
  // if you want to debug, this is a good time to do it!
  if (GPSECHO)
    if (c) UDR0 = c;  
    // writing direct to UDR0 is much much faster than Serial.print 
    // but only one character can be written at a time. 
    
}

void useInterrupt(boolean v) {
  if (v) {
    // Timer0 is already used for millis() - we'll just interrupt somewhere
    // in the middle and call the "Compare A" function above
    OCR0A = 0xAF;
    TIMSK0 |= _BV(OCIE0A);
    usingInterrupt = true;
  } else {
    // do not call the interrupt function COMPA anymore
    TIMSK0 &= ~_BV(OCIE0A);
    usingInterrupt = false;
  }
}

how do I decode the nema data?

It appears that the GPS instance of the Adafruit_GPS library does that.

okay I found it out what it was as I have a mega I was referring to serial1 to use port 0 and 1 of course it will not work so after figuring that out I used the following code on serial 1 on the mega with pins 19 and 18.

Lat/Long: -38.81841, 142.27853
Date: 2/15/2013 Time: 0:1:17.0
Altitude (meters): 1000000.00
Course (degrees): 0.00
Speed(kmph): 0.04
Satellites: 255

I found I only I have two issues left is that for some reason it is show 255 Satellites no idea why it must be something with the TinyGPS.h
and adjust the time zone to the correct format :slight_smile:

#include "TinyGPS.h"

TinyGPS gps;
int year;
byte month, day, hour, minute, second, hundredths;
unsigned long chars;
unsigned short sentences, failed_checksum;
static void print_date(TinyGPS &gps);


void setup()
{

 Serial.begin(9600);
 Serial1.begin(9600);
}


void loop()
{
while(Serial1 .available()) 
{
int c = Serial1 .read(); 
if(gps.encode(c)) 
{
float latitude, longitude;
gps.f_get_position(&latitude, &longitude);
Serial.print("Lat/Long: "); 
Serial.print(latitude,5); 
Serial.print(", "); 
Serial.println(longitude,5);
gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/"); 
Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
Serial.print(" Time: "); Serial.print(hour, DEC); Serial.print(":"); 
Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC); 
Serial.print("."); Serial.println(hundredths, DEC);
Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude()); 
Serial.print("Course (degrees): "); Serial.println(gps.f_course()); 
Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph());
Serial.print("Satellites: "); Serial.println(gps.satellites());
Serial.println();
gps.stats(&chars, &sentences, &failed_checksum);
}
}
}

I found I only I have two issues left is that for some reason it is show 255 Satellites no idea why it must be something with the TinyGPS.h

I think you have more than that. I'm not sure where that latitude and longitude is, but I'm willing to bet a dozen donuts that the elevation there is not 1000 kilometers (exactly) above sea level.

I did not even notice that I was 1000 meters above sea level for the purpose of this sketch I don't really need the altitude it was just in the default code from Tiny GPS.

Hi Onenate,

Got myself a GY-GPSMU1 and had a heck of a time trying to get it to work, eventually came across this page, and used your code above, and ...... whoohoo I can finally see something.

Similar Issues: Did you resolve the altitude, and number of satellites?

Many Thanks
T

I have Ublox NEO 6M V2.0 GPS module and arduino Mega. I can not get position any code. I hooked up on (rx)19 and 18(tx) pin. Does anyone help me?

Same problem as Geerobotics does anybody know how to proceed?

Bilick88:
Same problem as Geerobotics does anybody know how to proceed?

Yes, start your own thread rather than tag onto one that is almost 4 years old.

But you will need to describe your problem far better than post #16 above does.