# GPS no satellites

**URL:** <https://forum.arduino.cc/t/gps-no-satellites/453362>\
**Category:** Sensors\
**Created:** [April 20, 2017, 3:40am UTC](https://forum.arduino.cc/t/gps-no-satellites/453362 "2017-04-20T03:40:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![1035700564](https://avatars.discourse-cdn.com/v4/letter/1/a4c791/32.png) [@1035700564](https://forum.arduino.cc/u/1035700564)\
**Post date:** [April 20, 2017, 3:40am UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/1 "2017-04-20T03:40:53Z")

</div>

hi

I have Arduino Mega and hexTronik 1575-R A GPS. I

I found a code online and download their headerfile. the code keep printing 0 satelite found.

---

<div class="post-metadata">

**Author:** ![1035700564](https://avatars.discourse-cdn.com/v4/letter/1/a4c791/32.png) [@1035700564](https://forum.arduino.cc/u/1035700564)\
**Post date:** [April 20, 2017, 3:46am UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/2 "2017-04-20T03:46:12Z")

</div>

hi

I have Arduino Mega and hexTronik 1575-R A GPS. I want use this to know my location.

I found a code online and download their headerfile. the code keep printing 0 satelite found.

I have connect TX pin of GPS to arduino rx pin 15 and RX pin of GPS to arduino tx pin 14.

the code is below.

```cpp
#include "TinyGPS++.h"
#include "SoftwareSerial.h"

SoftwareSerial serial_connection(14,15); //RX=pin 10, TX=pin 11
TinyGPSPlus gps;//This is the GPS object that will pretty much do all the grunt work with the NMEA data
void setup()
{
  Serial.begin(9600);//This opens up communications to the Serial monitor in the Arduino IDE
  serial_connection.begin(9600);//This opens up communications to the GPS
  Serial.println("GPS Start");//Just show to the monitor that the sketch has started
  Serial.println("Satellite Count:");
  Serial.println(gps.satellites.value());
}

void loop()
{
  while(serial_connection.available())//While there are characters to come from the GPS
  {
    gps.encode(serial_connection.read());//This feeds the serial NMEA data into the library one char at a time
  }
  if(gps.location.isUpdated())//This will pretty much be fired all the time anyway but will at least reduce it to only after a package of NMEA data comes in
  {
    //Get the latest info from the gps object which it derived from the data sent by the GPS unit
    Serial.println("Satellite Count:");
    Serial.println(gps.satellites.value());
    Serial.println("Latitude:");
    Serial.println(gps.location.lat(), 6);
    Serial.println("Longitude:");
    Serial.println(gps.location.lng(), 6);
    Serial.println("Speed MPH:");
    Serial.println(gps.speed.mph());
    Serial.println("Altitude Feet:");
    Serial.println(gps.altitude.feet());
    Serial.println("");
  }
}

```

---

<div class="post-metadata">

**Author:** ![wildbill](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wildbill/32/1126438_2.png) [@wildbill](https://forum.arduino.cc/u/wildbill)\
**Post date:** [April 20, 2017, 11:33am UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/3 "2017-04-20T11:33:08Z")

</div>

> 1035700564:  
> I have connect TX pin of GPS to arduino rx pin 15 and RX pin of GPS to arduino tx pin 14.

Softwareserial constructor takes rx,tx. Your wiring is backwards.

---

<div class="post-metadata">

**Author:** ![dev\_1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dev_1/32/215847_2.png) [@dev\_1](https://forum.arduino.cc/u/dev_1)\
**Post date:** [April 20, 2017, 2:28pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/4 "2017-04-20T14:28:01Z")

</div>

> wildbill:  
> Your wiring is backwards.

+1

After switching your wires, you may still have trouble, because you are [printing too much](https://github.com/SlashDevin/NeoGPS/blob/master/extras/doc/Troubleshooting.md#printing-too-much).

I would also suggest using AltSoftSerial on pins 8 & 9 for the GPS device. SoftwareSerial is very inefficient, because it disables interrupts for long periods of time. This will interfere with other parts of your sketch.

If you really can't use pins 8 & 9, you should use my [NeoSWSerial](https://github.com/SlashDevin/NeoSWSerial). It is almost as good as AltSoftSerial, and it works at baud rates 9600, 19200 and 38400.

I would also suggest my [NeoGPS](https://github.com/SlashDevin/NeoGPS) library. It's smaller, faster and more accurate than all other libraries. The library and example programs are structured so that you would print information (or do other work) when the GPS device is done sending characters for a little while, during the GPS [quiet time](https://github.com/SlashDevin/NeoGPS/blob/master/extras/doc/Troubleshooting.md#quiet-time-interval). Your current sketch will try to print while the GPS device is still sending characters.

Here is your sketch, modified to use NeoGPS and AltSoftSerial:

```arduino
#include <NMEAGPS.h>
#include <AltSoftSerial.h>

AltSoftSerial gpsPort; // GPS TX to pin 8, GPS RX to pin 9
NMEAGPS gps;

void setup()
{
  Serial.begin(9600);
  gpsPort.begin(9600);
  
  Serial.println( F("GPS Start") );  // F macro saves RAM
}

void loop()
{
  if (gps.available( gpsPort ))
  {
    //Get the latest info from the gps object which it derived from the data sent by the GPS unit
    gps_fix fix = gps.read();

    Serial.print( F("Satellite Count:") );
    if (fix.valid.satellites)
      Serial.print( fix.satellites );
    Serial.print( F("\nLatitude:") );
    if (fix.valid.location)
      Serial.print( fix.latitude(), 6 );
    Serial.print( F("\nLongitude:") );
    if (fix.valid.location)
      Serial.print( fix.longitude(), 6 );
    Serial.print( F("\nSpeed MPH:") );
    if (fix.valid.speed)
      Serial.print( fix.speed_mph() );
    Serial.print( F("\nAltitude Meters:") );
    if (fix.valid.altitude)
      Serial.print( fix.altitude());
    Serial.println();
  }
}

```

The original sketch uses 8956 bytes of program space and 610 bytes of RAM.  
The NeoGPS version uses 8730 bytes of program space and 420 bytes of RAM

If you want to try it, it is also available from the Arduino IDE Library Manager, under the menu **Sketch -\> Include Library -\> Manage Libraries**. Be sure to read the Troubleshooting page for other tips.

Cheers,  
/dev

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 21, 2017, 3:30am UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/5 "2017-04-21T03:30:45Z")

</div>

I am using the Uno and have a similar problem. I used the direct hookup bypassing the Uno to make sure I had the NEMA sentence coming in and I do. However, when I use one of the many example programs to parse the data, all I get is zeroes. Any ideas? Thank you.

---

<div class="post-metadata">

**Author:** ![dev\_1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dev_1/32/215847_2.png) [@dev\_1](https://forum.arduino.cc/u/dev_1)\
**Post date:** [April 21, 2017, 12:28pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/6 "2017-04-21T12:28:02Z")

</div>

> I had the NEMA sentence coming in

Was it mostly empty data, like

```arduino
    $GPRMC,123519,A,,,,,,,230394,003.1,W*5F

```

That means the GPS device is connected correctly and you have the correct baud rate, but you do not have good satellite reception. Check the antenna connection and get closer to a window or go outside. The first fix could take 10 minutes or more.

You could also try NMEAdiagnostic.ino or NMEA.ino, but I suspect you do not have good reception.

> I used the direct hookup bypassing the Uno

Then you switched TX and RX to try a sketch, right?

Cheers,  
/dev

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 21, 2017, 1:32pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/7 "2017-04-21T13:32:40Z")

</div>

Hey Guys thanks for answering. Yes my NEMA sentenxe is loaded with all the data - lat, lon, alt, time, everything that was supposed to be there so I know I have the data stream coming in. Then when I try to route it through the Uno all I get in several of the programs is the header labels. I switched the Rx and TX but no diff. I'm not sure what I'm doing wrong but whatever it is it is consistent with all of the programs tried. Should I post the code of one of the programs for a look by you smarter guys? ??? JBB

---

<div class="post-metadata">

**Author:** ![dev\_1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dev_1/32/215847_2.png) [@dev\_1](https://forum.arduino.cc/u/dev_1)\
**Post date:** [April 21, 2017, 2:09pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/8 "2017-04-21T14:09:04Z")

</div>

You tried NeoGPS? It won't output zeros or asterisks. Try the NMEAsimple.ino, and edit it to use the correct serial port and baud.

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 21, 2017, 2:25pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/9 "2017-04-21T14:25:12Z")

</div>

Yes, I just found the NeoGPS and can't wait to try it. Trouble is I'm out of town and have to get back home first. I'll update as soon as I try it and thank you.

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 22, 2017, 10:48pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/10 "2017-04-22T22:48:31Z")

</div>

I know this is an easy answer but I just got the NeoGPS downloaded and when I look at the unzipped file there is no .h or .cpp file in it. Also, the README file is a .MD. Am I supposed to be able to read this? Thank you. JBB

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 23, 2017, 12:37am UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/11 "2017-04-23T00:37:49Z")

</div>

Hey dev,

I just noticed my library files are pretty much the way their supposed to be with a couple of issues.

First of all, the .cpp files are there with the .cpp file extension but the H file is also there without the extension. What's up with that, the file has no extension but loads the library just like it was there?

Secondly, the NeoGPS folder unzipped didn't give the two files .h and .cpp and when included in a program gave a #include\<NMEAGPS.h\> label in the program.

The NeoSWSerial folder has the .cpp file but the .h file is the one with no extension.

The Neo files obviously are doing something different. Thank you for your great explanations.

Thank you. JBB

---

<div class="post-metadata">

**Author:** ![dev\_1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dev_1/32/215847_2.png) [@dev\_1](https://forum.arduino.cc/u/dev_1)\
**Post date:** [April 23, 2017, 3:51pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/12 "2017-04-23T15:51:39Z")

</div>

Just follow the [NeoGPS Install instructions](https://github.com/SlashDevin/NeoGPS/blob/master/extras/doc/Installing.md) or re-read reply #3. All the NeoGPS source code is in a **sub** directory called `src`.

NeoSWSerial is a typical Arduino library that you simply unzip into Arduino\Libraries directory. That would create Arduino\Libraries\NeoSWSerial-master directory, which you can rename to Arduino\Libraries\NeoSWSerial, if you want.

If you're on Windows, you may have selected a Windows Explorer option to "Hide extensions for known file types", under **View -\> Options -\> Change Folder and Search Options** , in the **View** tab.

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 24, 2017, 5:46pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/13 "2017-04-24T17:46:35Z")

</div>

Dev

Thank you for that explanation! JBB

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 24, 2017, 8:23pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/14 "2017-04-24T20:23:58Z")

</div>

Hi,  
I got this error message when uploading the basic GPS sketch which bypasses the Arduino to check for GPS signal. Any idea what the problem is?

Arduino: 1.8.2 (Windows 7), Board: "Arduino/Genuino Uno"

avrdude: stk500\_getsync() attempt 10 of 10: not in sync: resp=0x00

An error occurred while uploading the sketch

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 24, 2017, 8:40pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/15 "2017-04-24T20:40:00Z")

</div>

For anyone else who sees an erroe like this, I think this is due to incorrect wiring. I switched the rx and tx pins and I have a steady GPS sentence stream coming out! JBB

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 25, 2017, 12:01pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/16 "2017-04-25T12:01:01Z")

</div>

I have loaded, compiled and run a GPS sketch and then loaded a new GPS sketch which gives the following error message. I switch back to the previously run sketch and it compiles and runs again no problem. My computer says com3 is active. Any ideas what is wrong? Thank you. JBB

Arduino: 1.8.2 (Windows 7), Board: "Arduino/Genuino Uno"

Sketch uses 8098 bytes (25%) of program storage space. Maximum is 32256 bytes.  
Global variables use 586 bytes (28%) of dynamic memory, leaving 1462 bytes for local variables. Maximum is 2048 bytes.  
avrdude: ser\_open(): can't open device "\.\COM3": Access is denied.

Problem uploading to board. See [http://www.arduino.cc/en/Guide/Troubleshooting#upload](http://www.arduino.cc/en/Guide/Troubleshooting#upload) for suggestions.

This report would have more information with  
"Show verbose output during compilation"  
option enabled in File -\> Preferences.

---

<div class="post-metadata">

**Author:** ![dev\_1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dev_1/32/215847_2.png) [@dev\_1](https://forum.arduino.cc/u/dev_1)\
**Post date:** [April 25, 2017, 1:42pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/17 "2017-04-25T13:42:22Z")

</div>

Do you have two IDE windows open at the same time? Be sure to close the Serial Monitor windows before uploading.

You don't have GPS TX connected to Arduino pin 0 while uploading, right?

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [April 26, 2017, 5:05pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/18 "2017-04-26T17:05:27Z")

</div>

Yeah dev, I was committing all those errors!!! Thank you.  
Great hints for me to correct immediately.  
And, I noticed the altitude readout varies considerably over the course of a day/night cycle.  
Right now we are in a decreasing mode from a max height earlier in the day. The difference in altitude is around 100 to 150 feet. I know the earth isn't round but I'm just sitting here in one place. What's up?

---

<div class="post-metadata">

**Author:** ![dev\_1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dev_1/32/215847_2.png) [@dev\_1](https://forum.arduino.cc/u/dev_1)\
**Post date:** [April 26, 2017, 7:55pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/19 "2017-04-26T19:55:48Z")

</div>

It's just the typical GPS jitter. It's a random walk around your 3D position (lat,lon,alt).

---

<div class="post-metadata">

**Author:** ![hr2guy](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@hr2guy](https://forum.arduino.cc/u/hr2guy)\
**Post date:** [May 1, 2017, 10:19pm UTC](https://forum.arduino.cc/t/gps-no-satellites/453362/20 "2017-05-01T22:19:25Z")

</div>

Hi Dev,

I loaded the code you had suggested to someone else and, using the hints you gave earlier, it loaded and ran pretty well. Questions I have:

1. I am getting Latitude: 39,957431 and  
Longitude: -860180660.01

even though 6 digits are asked for (I believe) with this - "Serial.print( fix.longitude(), 6 ); ?" Do I do some math to get it to typical units for location? Hints for that?

1. Is there a source of commands for the GPS so I can change units, i.e. Meters to Feet, etc?

2. I am trying to use this GPs for location while I record "g" loads and occasionally add location. Is there a simple way to ask for elapsed time so that every 10 seconds I could have it stop recording and start over?

Thank you.

#include \<NMEAGPS.h\>  
#include \<AltSoftSerial.h\>

AltSoftSerial gpsPort; // GPS TX to pin 8, GPS RX to pin 9  
NMEAGPS gps;

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

Serial.println( F("GPS Start") ); // F macro saves RAM  
}

void loop()  
{  
if (gps.available( gpsPort ))  
{  
//Get the latest info from the gps object which it derived from the data sent by the GPS unit  
gps\_fix fix = gps.read();

Serial.print( F("Satellite Count:") );  
if (fix.valid.satellites)  
Serial.print( fix.satellites );  
Serial.print( F("\nLatitude:") );  
if (fix.valid.location)  
Serial.print( fix.latitude(), 6 );  
Serial.print( F("\nLongitude:") );  
if (fix.valid.location)  
Serial.print( fix.longitude(), 6 );  
[//Serial.print](https://Serial.print)( F("\nSpeed MPH:") );  
//if (fix.valid.speed)  
Serial.print( fix.speed\_mph() );  
Serial.print( F("\nAltitude Meters:") );  
if (fix.valid.altitude)  
Serial.print( fix.altitude());  
Serial.println();  
Serial.println();  
}  
}

[Next page](https://forum.arduino.cc/t/gps-no-satellites/453362.md?page=2)
