MKR GSM 1400 keeps crashing when running through the loop

Hi everyone,

I am really stuck with trying to get a MKR GSM 1400 to connect to Arduino IOT cloud with a Giffgaff sim.

Current setup is:

MKR GSM 1400 powered by 3.7v LiPo battery (fully charged)
USB cable into the MKR GSM for serial port monitoring
Giffgaff sim card

I am just trying to upload the default IOT cloud sketch with one bool variable called "led".

I have used the details specified by giffgaff for connection which is as follows:
APN - giffgaff.com
Pin - They say leave it blank but arduino requires it so I have used 5555
Username - gg
Password - p

With a blank sketch pushed to it, the MKR GSM sits there nicely. As soon as I try and program it with the IOT sketch it takes the program, output the device ID to the serial monitor, outputs "MQTT Broker: mqtts-sa.iot.arduino.cc:8883" an then disconnects from the PC and restarts. Connects itself again, outputs the same device ID and MQTT message and restarts continuously.

At fist I thought it was my board so I bought a new one. Then, when this did the same I tried having additional power (LiPo & power from PC usb) and this still doesn't work.

I have googled for weeks but can't seem to throw any further light on what could be wrong. Is anyone able to help me please?

I have also tried running the following code to see how far it gets and for some reason it always seems to crash after doing 5 or 6 "loops"

/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
  https://create.arduino.cc/cloud/things/7076ff59-09a7-4559-bf35-632285519f6a 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  CloudLocation coordinates;
  bool status;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(5000); 

  // Defined in thingProperties.h
  initProperties();
  Serial.println("Intialised Properties");
  delay(1000);

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  delay(1000);
  Serial.println("Started Arduino Cloud");
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(4);
  delay(1000);
  Serial.println("Set Debug Level");
  delay(1000);
  ArduinoCloud.printDebugInfo();
  delay(1000);
  Serial.println("Debugged");
  delay(2000);
}

void loop() {
  Serial.println("into the loop");
  // Your code here 
  //coordinates = Location(78.517541210126, 36.236772410127);
  delay(2000);
  Serial.println("Finished Loop");
  //ArduinoCloud.update();
}

/*
  Since Status is READ_WRITE variable, onStatusChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onStatusChange()  {
  // Add your code here to act upon Status change
}

It is like it on both boards.

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