Hello dear Community,
I searched in the forums for over two hours now and there was no solution that worked for me and some threads don't even have a solution available. Unfortunately, many people that started the thread didn't respond whether a solution worked for them or not.
I am using the MKR WAN1310-Board and want to use the MKR GPS via I2C-Cable on that. As many other users described in other threads, the GPS.available() function never returns a 1, only 0. I did not solder any bridges, I kept them standard (https://www.arduino.cc/en/Guide/MKRGPSShield).
I couldn't test this outdoors, but I was able to test the code at an open window, I waited some minutes but it didn't change anything.
Maybe it is worth mentioning that I use the current Beta-Version of Arduino. I used the standard example code which I only modified at one line, where I made GPS.begin() to GPS.begin(GPS_MODE_I2C), just to be sure.
/*
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(GPS_MODE_I2C)) {
Serial.println("Failed to initialize GPS!");
while (1);
}
else
Serial.println("GPS init success");
}
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();
}
}
Hopefully, someone has experience with that and can help me. Thank you in advance!