Library Requested to Support the MKR Series

You can follow all tutorials and examples Arduino provides. To use a Hologram SIM and the Hologram Cloud here are the key parts of @Maiky’s scrip.

Step 1: Gaining network access:

Arduino’s MKRGSM Library requires a few global variables to access the SIM. Specifically, for the Hologram SIM all you need to provide is the APN "hologram". The SIM pin, login, and password can be left blank.

Step 2a (optional): Connect to Hologram’s Server

You’ll need to open a TCP connection to our server with this information.

GSMClient client;
// Hologram's Embedded API (https://hologram.io/docs/reference/cloud/embedded/) URL and port
char server[] = "cloudsocket.hologram.io";
int port = 9999;

void setup() {
  client.connect(server, port)
}

Step 2b: Send data to the Hologram Cloud

In order for our cloud to accept new data and attribute it to the correct user and device, we need all data to be specifically formatted as a string in the following structure. {"k": "DEVICE_KEY", "d": "MESSAGE", "t": "TOPIC(S)"}

String DEVICE_KEY = "lkdfjkdjfkjds";
String MESSAGE = "Your Message here";
String TOPIC = "topic";

if (client.connected()) {
  // Send a Message request:
  client.println("{\"k\":\""+DEVICE_KEY+"\",\"d\":\""+ MESSAGE+"\",\"t\":\""+TOPIC+"\"}");
}

Hope this helps. We’re working on some MKR resources and will be sure to share once they’re ready.

3 Likes