MKR GPS Shield + MKR GSM 1400 Hangs when sending location data to Arduino IOT

Hey all, I saw a few posts about the GPS shield not working with Arduino IOT cloud. Arduino IoT and MKR GPS library Compatibility · Issue #8 · arduino-libraries/Arduino_MKRGPS · GitHub. It looks like this is a recent issue with the GPS library. I followed how to update location using this guide with CloudLocation.h: Location in IOT cloud - IoT Cloud - Arduino Forum. I notice that the ArduinoCloud.update() is killing the MKR GPS Shield. This is why I tried to start the GPS each loop iteration. Still no luck. The coordinates stay at 0,0. I was able to upload acceleration data to the IOT cloud but no location. Is this a bug or is it just me? I have included a picture and code for reference.

Olympia_mar15a.zip (2.21 KB)

Hi, I also had the pleasure to try my luck bringing the MKR GSM 1400 with the MKR GPS Shield to work using the Arduino IoT Cloud, but unfortunately without sucess. One thing I tried and saw in another topic was setting the Wire clock frequency to 400000, because apparently somehow the "ArduinoCloud.update()" function seems to increase this frequency, so that some I²C sensors do not work properly.

When I ran an I²C scanner during an IoT sketch, I also noticed that (without setting Wire clock) the GPS shield (connected via I²C) could only be found UNTIL the first connection to IoT cloud.

You can try that by including <Wire.h> and call Wire.setClock(400000) right after the Arduino update function.

As a result it worked out at least for a few loops. I can really recommend using ThingSpeak instead of IoT Cloud. I have no problems there until now, with the same devices (it uses significantly less memory on the MKR GSM (~62% to ~14%).

One addition: I would suggest to keep the GPS.begin() in the setup function, not in the loop.

You could replace your code from 32-34 with following in order to first check, if a valid GPS sentence is available and only then ask for lat/lon:

start = millis();
  
while(millis() - start < 10000){
if (GPS.available()) {
  // read GPS values
  latitude = GPS.latitude();
  longitue = GPS.longitude();
  location = Location(latitude, longitude);     
  break;
 }

Finally some good advice! I will look into ThingSpeak and try out the I2C methods you mentioned. I will try this out and report back soon.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.