# MKR GPS Shield not working

**URL:** <https://forum.arduino.cc/t/mkr-gps-shield-not-working/643806>\
**Category:** MKR Shields\
**Created:** [March 22, 2020, 12:38pm UTC](https://forum.arduino.cc/t/mkr-gps-shield-not-working/643806 "2020-03-22T12:38:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![indyvc](https://avatars.discourse-cdn.com/v4/letter/i/c37758/32.png) [@indyvc](https://forum.arduino.cc/u/indyvc)\
**Post date:** [March 22, 2020, 12:38pm UTC](https://forum.arduino.cc/t/mkr-gps-shield-not-working/643806/1 "2020-03-22T12:38:16Z")

</div>

Hello guys,

I have an MKR GSM board with en MKR GPS Shield attached to it with an I2C Cable.

I have the following code:

```cpp
/*
  GPS Location
  This sketch uses the GPS to determine the location of the board
  and prints it to the Serial monitor.
  Circuit:
  - MKR board
  - MKR GPS attached via I2C cable
  This example code is in the public domain.
*/

#include <Arduino_MKRGPS.h>

void setup() {
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // If you are using the MKR GPS as shield, change the next line to pass
  // the GPS_MODE_SHIELD parameter to the GPS.begin(...)
  if (!GPS.begin()) {
    Serial.println("Failed to initialize GPS!");
    while (1);
  }
}

void loop() {
  // check if there is new GPS data available
  if (GPS.available()) {
    // read GPS values
    float latitude  = GPS.latitude();
    float longitude  = GPS.longitude();
    float altitude  = GPS.altitude();
    float speed      = GPS.speed();
    int  satellites = GPS.satellites();

    // print GPS values
    Serial.print("Location: ");
    Serial.print(latitude, 7);
    Serial.print(", ");
    Serial.println(longitude, 7);

    Serial.print("Altitude: ");
    Serial.print(altitude);
    Serial.println("m");

    Serial.print("Ground speed: ");
    Serial.print(speed);
    Serial.println(" km/h");

    Serial.print("Number of satellites: ");
    Serial.println(satellites);

    Serial.println();
  }
}

```

It never seems to get past GPS.available and I really don't know why. I've been struggling for about 2 days.

I have tried other cabled, other USB ports, attaching a LIPO to it, tried other computers, ...

Hope u can help, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 7, 2021, 11:57am UTC](https://forum.arduino.cc/t/mkr-gps-shield-not-working/643806/3 "2021-05-07T11:57:52Z")

</div>

Closed on May 7, 2021, 11:57am UTC


