user8761: I have Arduino Mega and Weather shield and GPS Receiver - GP-635T (50 Channel).
here is my code for GPS
#include <SoftwareSerial.h>
#include <TinyGPS++.h>

TinyGPSPlus gps;

static const int RXPin = 5, TXPin = 4;
SoftwareSerial ss(RXPin, TXPin);

const byte GPS_PWRCTL = 6;

void setup()
{
  Serial.begin(9600);
  ss.begin(9600);

  pinMode(GPS_PWRCTL, OUTPUT);
  digitalWrite(GPS_PWRCTL, HIGH);
}

void loop()
{
  smartdelay(800);
}

And print weather with this code
void printWeather()
{
  Serial.print("lat=");
  Serial.print(gps.location.lat(), 6);
  Serial.print("lat=");
  Serial.print(gps.location.lng(), 6);
  Serial.print("altitude=");
  Serial.print(gps.altitude.meters());
  Serial.print("sats=");
  Serial.print(gps.satellites.value());

  char sz[32];
  Serial.print("date=");
  sprintf(sz, "%02d/%02d/%02d", gps.date.month(), gps.date.day(),gps.date.year());
  Serial.print(sz);

  Serial.print("time=");
  sprintf(sz, "%02d:%02d:%02d", gps.time.hour(), gps.time.minute(), gps.time.second());
  Serial.print(sz);
}

But I see only zero for location and date and time. What should I do?

user14737: Until you have the correct baud rate and good satellite reception, many fields will be zero or empty.  I wrote a diagnostic program for NeoGPS that will try different baud rates and confirm that the GPS device is functioning.  The example program is in this directory:
examples/NMEAdiagnostic

Installation instructions are here.
If you're inside, you may not be able to receive anything.  Move next to a window or go outside.

8761: <p>I have Arduino Mega and Weather shield and GPS Receiver - GP-635T (50 Channel).</p>

<p>here is my code for GPS</p>

<pre><code>#include &lt;SoftwareSerial.h&gt;
#include &lt;TinyGPS++.h&gt;

TinyGPSPlus gps;

static const int RXPin = 5, TXPin = 4;
SoftwareSerial ss(RXPin, TXPin);

const byte GPS_PWRCTL = 6;

void setup()
{
  Serial.begin(9600);
  ss.begin(9600);

  pinMode(GPS_PWRCTL, OUTPUT);
  digitalWrite(GPS_PWRCTL, HIGH);
}

void loop()
{
  smartdelay(800);
}
</code></pre>

<p>And print weather with this code</p>

<pre><code>void printWeather()
{
  Serial.print("lat=");
  Serial.print(gps.location.lat(), 6);
  Serial.print("lat=");
  Serial.print(gps.location.lng(), 6);
  Serial.print("altitude=");
  Serial.print(gps.altitude.meters());
  Serial.print("sats=");
  Serial.print(gps.satellites.value());

  char sz[32];
  Serial.print("date=");
  sprintf(sz, "%02d/%02d/%02d", gps.date.month(), gps.date.day(),gps.date.year());
  Serial.print(sz);

  Serial.print("time=");
  sprintf(sz, "%02d:%02d:%02d", gps.time.hour(), gps.time.minute(), gps.time.second());
  Serial.print(sz);
}
</code></pre>

<p>But I see only zero for location and date and time. What should I do?</p>
 14737: <p>Until you have the correct baud rate <em>and</em> good satellite reception, many fields will be zero or empty.  I wrote a diagnostic program for <a href="https://github.com/SlashDevin/NeoGPS" rel="nofollow">NeoGPS</a> that will try different baud rates and confirm that the GPS device is functioning.  The example program is in this directory:</p>

<pre><code>examples/NMEAdiagnostic
</code></pre>

<p>Installation instructions are <a href="https://github.com/SlashDevin/NeoGPS/blob/master/doc/Installing.md" rel="nofollow">here</a>.</p>

<p>If you're inside, you may not be able to receive anything.  Move next to a window or go outside.</p>
