Shop OBEX P1 Docs P2 Docs Learn Events
Position coordinates not updated, PMB-688 gps module and arduino issue — Parallax Forums

Position coordinates not updated, PMB-688 gps module and arduino issue

ellepiuellepiu Posts: 1
edited 2012-06-10 13:08 in Accessories
Hi
I bought a PMB-688 GPS receiver and an Arduino Uno. I need to get gps location coordinates to serial monitor. I connected yellow gps cable to digital pin 6, red cable to 5v, black to ground.
After a couple of seconds, the Gps led stops blinking and stays solid.
I used tinyGPS and SoftwareSerial library. Following is the code I used:
#include <SoftwareSerial.h>
#include "TinyGPS.h"                 // Special version for 1.0


TinyGPS gps;
SoftwareSerial nss(6, 255);            // Yellow wire to pin 6


void setup() {
  Serial.begin(9600);
  nss.begin(4800);
  Serial.println("Reading GPS");
}


void loop() {
  bool newdata = false;
  unsigned long start = millis();
  while (millis() - start < 5000) {  // Update every 5 seconds
    if (feedgps())
      newdata = true;
  }
  if (newdata) {
    gpsdump(gps);
  }
}


// Get and process GPS data
void gpsdump(TinyGPS &gps) {
  float flat, flon;
  unsigned long age;
  gps.f_get_position(&flat, &flon, &age);
  Serial.print(flat, 6); Serial.print(", "); 
  Serial.println(flon, 6);
}


// Feed data as it becomes available 
bool feedgps() {
  while (nss.available()) {
    if (gps.encode(nss.read()))
      return true;
  }
  return false;
}

When powered on, arduino serial monitor lists latitude and longitude coordinates, but they're always the same, even when I move gps module.

Does anybody knows why this could happens? Suggestions are appreciated!


Indeed, I checked the raw strings received without tinyGPS library, and it turned out that some GPRMC messages overlaps with GPGGA messages such as:
$GPRMC,143044.000$GPGGA,143045.000,4152.9430,N,01119.2805,E,2,10,0.8,50.0,M,46.8,M,1.8,0000*45


Thanks for your help!
Sign In or Register to comment.