Some progress, I guess...
From what I can gather (please correct me someone if I'm wrong), the ArduinoMKRGPS library uses UART when the GPS module is connected as a shield.
So, now I've been trying to adapt this code example from the Sparkfun library. Having a hard time with that as well though since it uses SoftwareSerial, something my board (a MKR GSM 1400) doesn't support due to having hardware serial on pins 13/14.
Including the UART code example here as well, in case anyone's interested (unaltered, so obviously #include <SoftwareSerial.h> and the line after won't work out of the box, that's what I'm trying to figure out now):
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
SFE_UBLOX_GNSS myGNSS;
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX. Pin 10 on Uno goes to TX pin on GNSS module.
long lastTime = 0; //Simple local timer. Limits amount of I2C traffic to u-blox module.
void setup()
{
Serial.begin(115200);
while (!Serial); //Wait for user to open terminal
Serial.println("SparkFun u-blox Example");
//Assume that the U-Blox GNSS is running at 9600 baud (the default) or at 38400 baud.
//Loop until we're in sync and then ensure it's at 38400 baud.
do {
Serial.println("GNSS: trying 38400 baud");
mySerial.begin(38400);
if (myGNSS.begin(mySerial) == true) break;
delay(100);
Serial.println("GNSS: trying 9600 baud");
mySerial.begin(9600);
if (myGNSS.begin(mySerial) == true) {
Serial.println("GNSS: connected at 9600 baud, switching to 38400");
myGNSS.setSerialRate(38400);
delay(100);
} else {
//myGNSS.factoryReset();
delay(2000); //Wait a bit before trying again to limit the Serial output
}
} while(1);
Serial.println("GNSS serial connected");
myGNSS.setUART1Output(COM_TYPE_UBX); //Set the UART port to output UBX only
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
myGNSS.saveConfiguration(); //Save the current settings to flash and BBR
}
void loop()
{
//Query module only every second. Doing it more often will just cause I2C traffic.
//The module only responds when a new position is available
if (millis() - lastTime > 1000)
{
lastTime = millis(); //Update the timer
long latitude = myGNSS.getLatitude();
Serial.print(F("Lat: "));
Serial.print(latitude);
long longitude = myGNSS.getLongitude();
Serial.print(F(" Long: "));
Serial.print(longitude);
Serial.print(F(" (degrees * 10^-7)"));
long altitude = myGNSS.getAltitude();
Serial.print(F(" Alt: "));
Serial.print(altitude);
Serial.print(F(" (mm)"));
byte SIV = myGNSS.getSIV();
Serial.print(F(" SIV: "));
Serial.print(SIV);
Serial.println();
}
}