I just received my MKR GSM1400 Cellular Kit 3 days ago, I registered the Arduino SIM online and after leaving it for ~36h to activate, I went through process as per the official Arduino guides to update the IDE, install the MKRGSM, ArduinoCloud, and 32-bit SAMD libraries as well as installing the MKR GSM 1400 Board and ArduinoCreateAgent, and I also tried giving external 3.8VDC power via Vin and GND. and if I'm missing something in that list, I promise I've tried everything (including an actual data microUSB cable which I've confirmed working & rebooting). I also tried another computer. (the antenna was plugged in, and reception in my room near the window was good according to my phone, and the SIM was in the correct orientation, CreateAgrent was also running in the background)
arduino_secrets.h was filled out using the following values:
SECRET_PIN: 0000 (I also tried 1234 but it didn't work)
APN: prepay.pelion
Login User: arduino
Login Pass: arduino
First, I tried using uploading the the "offline" IDE with the built in examples from the MKRGSM library, so I tried both GPRS Ping to 'www.google.com' and also the GSM web client example also to 'www.google.com'
The only thing that came up in the serial display was "Connecting to GSM Network" and the occasional "Not Connected"
Arduino IoT cloud managed to successfully add the device, and I made the 'led' variable with the little switch on my browser. But when I tried it out, it didn't blink the onboard LED, and Arduino Cloud was also showing the device as "Offline". I tried deleting the device and rebooting, restarted everything several times and it still doesn't work.
Here's The Code I'm Using:
/*
Web client
This sketch connects to a website through a MKR GSM 1400 board. Specifically,
this example downloads the URL "http://www.example.org/" and
prints it to the Serial monitor.
Circuit:
* MKR GSM 1400 board
* Antenna
* SIM card with a data plan
created 8 Mar 2012
by Tom Igoe
*/
// libraries
#include <MKRGSM.h>
#include "arduino_secrets.h"
// Please enter your sensitive data in the Secret tab or arduino_secrets.h
// PIN Number
const char PINNUMBER[] = "0000";
// APN data
const char GPRS_APN[] = "prepay.pelion"
const char GPRS_LOGIN[] = "arduino";
const char GPRS_PASSWORD[] = "arduino";
// initialize the library instance
GSMClient client;
GPRS gprs;
GSM gsmAccess;
// URL, path and port (for example: example.org)
char server[] = "google.com";
char path[] = "/";
int port = 80; // port 80 is the default for HTTP
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
}
Serial.println("Starting Arduino web client.");
// connection state
bool connected = false;
// After starting the modem with GSM.begin()
// attach the shield to the GPRS network with the APN, login and password
while (!connected) {
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
connected = true;
} else {
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect(server, port)) {
Serial.println("connected");
// Make a HTTP request:
client.print("GET ");
client.print(path);
client.println(" HTTP/1.1");
client.print("Host: ");
client.println(server);
client.println("Connection: close");
client.println();
} else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop() {
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}
// if the server's disconnected, stop the client:
if (!client.available() && !client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
// do nothing forevermore:
for (;;)
;
}
}