MKR1400 GSM Sparkfun GPS Thinger example

Hello,

I am new to Thinger.io and it looks like a great platform to work with.

I am able to connect the Arduino MKR 1400 GSM board to thinger and control the on-board LED. My goal is to connect the Arduino MKR 1400 GSM board with the Sparkfun Ublox SAM-8Q GNSS board using I2C and be able to send GPS co-ordinates and speed to thinger platform and be able to view the data remotely.

I have a running Arduino sketch example for reading the co-ordinates and speed from the M8Q GPS module but I just don’t know how to add/connect it to the thinger platform.

Can someone please help me out and advise how this could be done ?

Thanks
ANC

Hi,

I would begin for defining the resource with the needed info

    thing["GPS_DATA"] >> [](pson &out)
    {
      out["Lat"] = lat;
      out["Long"] = long;
      out["Speed"] = speed;
      out["Acceleration"] = acceleration;
      //any other value you need to upload
    };

Then you can setup a bucket that retrieves the values from the device at certain frequency… or you can write the values to a bucket, I prefer the second option due I know when the device calculates the parameters, so when its done doing this, it can upload directly to the cloud.

the command to upload the values is:

thing.write_bucket("BUCKET_NAME", "GPS_DATA");

Hope this helps.

Hi,

Thanks for your reply.

I am not very familar with this format.

If I paste my original Arduino code here would you be able to show me where and what needs to be chnaged and defined?

Hi,

Is this the right way to implement it ?

thing[“location”] >> [](pson & out) {

out["lat"] = myGNSS.getLatitude();
out["lon"] = myGNSS.getLongitude();
Serial.print("Latitute: ");
Serial.println(latitude / 10000000, 7);
Serial.print("Longitute: ");
Serial.println(longitude / 10000000, 7);

};

thing[“speed”] >> [](pson & out) {

out["speed"] = myGNSS.getLatitude();
Serial.print("speed: ");
Serial.println(speed / 447); 

};

And in the loop have these two lines for the buckets.

thing.write_bucket(“location”, “location”);
thing.write_bucket(“speed”, “speed”);

Please check the thinger examples sketch to get familiar with that.

Note that you need to control how to upload info to the cloud, you cant upload info at the speed the microcontroller can, this will generate a huge amount of data and the server will ban the device.

For your particular case I think just defining the resources at the setup and configuring the bucket to retrieve the data would work, because the GPS library keeps estimating those values constantly.

Try it and let me know how it goes.