GSM fails to connect, two different boards.

Arduino version: 1.8.11
Environment: Windows 10 desktop
SAMD boards version: 1.8.9
Hello, I am trying to just get the board (MKR GSM 1400) to connect by following various boiler plate code examples available from or other threads.
I have separated the GSM and GPRS functions to help with debugging. I have the device plugged into USB and an antenna plugged in as well. I am not supplying external power. I have tried:

gsmAccess.begin(true, false);

Out of the last 4 hours I have been messing with this, it connected once. GPRS never did. when I restarted the board, GSM never successfully began ever again. I get the following debug output repeatedly:

+CREG: 0,0

Here is the code:

#include <MKRGSM.h>

const char PINNUMBER[] = " "; 
const char GPRS_APN[] = "hologram";
const char GPRS_LOGIN[] = " ";
const char GPRS_PASSWORD[] = " ";
// these are irrelevant since the device cant access the network to begin with
// String HOLOGRAM_DEVICE_KEY = "1234abcd";
// String HOLOGRAM_MESSAGE = "Your Message here";
// Hologram's Embedded API ( URL and port
// char server[] = "";
// int port = 9999;

// initialize the library instance
GSMClient client;
GPRS gprs;
GSM gsmAccess(true); //true to enable debugging

bool flag = false;
int gsmBeginStatus;
int gprsAttachStatus;

void setup() 
     // initialize serial communications and wait for port to open:
    while (!Serial) {};
    Serial.println("Starting Arduino web client.");
    // connection state
    boolean connected = false;
    while (!connected) 
        Serial.println("Begin gsm Access");
        gsmBeginStatus = gsmAccess.begin();        
        if ((gsmBeginStatus == GSM_READY))
            Serial.println("gsm access success!");
            flag = true;
            Serial.println("gsm failed to begin.");
            Serial.println("attaching gprs...");
            //delay(2000); //tried with and without delays
            gprsAttachStatus = gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD);
            if(gprsAttachStatus == GPRS_READY) 
                connected = true;
                Serial.println("gprs attached!");
                Serial.println("gprs failure.");
            Serial.println("Not connected");
    Serial.println("setup complete.");

// the loop function runs over and over again forever
void loop() 


??? Please help. Thanks in advance.


The battery is required for the device to work. I didn’t realize this, and other threads with similar issues never pointed this out. So anyone else come across this in the future, plug the battery in before testing the code :slight_smile: (I tend to incrementally test from the other direction, software first).

Please make sure that you have an antenna attached to the MKR GSM 1400 board. If you still face any issue, please feel free to escalate your issue to the

//Arduino Support Team :slight_smile:


The battery is required for the device to work.

Battery is NOT required to run the MKR and connect to GSM/GPRS, check that your power supply provide enough power.