MKR GSM 1400 - Not Connection

Good afternoon.
I am experimenting with the MKR1400GSM and a "Thing Mobile" data card. I have tested the card with a mobile phone and disabled the PIN. With the mobile phone establish the connection correctly.
I'm trying with the Arduino, with the example program and I can't make the connection. I've done some testing and I can't see where the error is.

My code:

//https://docs.arduino.cc/tutorials/mkr-gsm-1400/gsm-location


// 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[]     = SECRET_PINNUMBER;
// APN data
const char GPRS_APN[]      = SECRET_GPRS_APN;
const char GPRS_LOGIN[]    = SECRET_GPRS_LOGIN;
const char GPRS_PASSWORD[] = SECRET_GPRS_PASSWORD;

// initialize the library instance
GSMLocation location;
GPRS gprs;
GSM gsmAccess;
GSMPIN PINManager;

bool auth = false;

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("Inici SETUP ***************");

  /*
  PINManager.begin();
  while(!auth)
    {
    int pin_query = PINManager.isPIN();
    if(pin_query == 1)
      {
      Serial.print("Pin_query:"); Serial.println(pin_query);
      Serial.println("No pin necessary.");
      auth = true;
      }
    }
  */
  
  Serial.println("Starting GSM location.");
  // connection state
  bool connected = false;


  // After starting the modem with GSM.begin()
  // connect to the GPRS network with the APN, login and password
  while (!connected) 
    {
    Serial.println("Aqui");  
    //if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
    //    (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) 
    if (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)
      
      {
      Serial.println("Connected");  
      connected = true;
      } 
    else 
      {
      Serial.println("Not connected");
      delay(1000);
      }
    Serial.println("?");    
    }
  
  location.begin();
  Serial.println("Fi Setup");  
  } 

void loop() 
  {
  if (location.available()) 
    {
    Serial.print("Location: ");
    Serial.print(location.latitude(), 7);
    Serial.print(", ");
    Serial.println(location.longitude(), 7);

    Serial.print("Altitude: ");
    Serial.print(location.altitude());
    Serial.println("m");

    Serial.print("Accuracy: +/- ");
    Serial.print(location.accuracy());
    Serial.println("m");

    Serial.println();
    }
  }

arduino_secret.h -->

//APM Movistar: APN:movistar.es User:MOVISTAR PW:MOVISTAR MCC:214 MNC:7
//APN Tings Movile=TM; Movistar="movistar.es"; Vodafone="airtelwap.es";

//#define SECRET_PINNUMBER ""
//#define SECRET_GPRS_APN "movistar.es"
//#define SECRET_GPRS_LOGIN "MOVISTAR"
//#define SECRET_GPRS_PASSWORD "MOVISTAR"

#define SECRET_PINNUMBER ""
#define SECRET_GPRS_APN "TM"
#define SECRET_GPRS_LOGIN ""
#define SECRET_GPRS_PASSWORD ""

I changed the line:

//GSM gsmAccess;
GSM gsmAccess(true);     // include a 'true' parameter for debug enabled
 Serial.println("Aqui");  
    //if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
    //    (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) 
    if (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)

Result:

Inici SETUP ***************
Starting GSM location.
Aqui
AT

OK
AT+IPR=921600

OK
AT

OK
AT+UPSV=3

OK
AT+CPIN?

ERROR
AT+CPIN?

+CPIN: READY

OK
AT+CMGF=1

OK
AT+UDCONF=1,1

OK
AT+CTZU=1

OK
AT+UDTMFD=1,2

OK
AT+CREG?

...

+CREG: 0,0

OK

+UMWI: 0,1

+UMWI: 0,2

+UMWI: 0,3

etc...

AT+ULOC=2,2,0,1,1

OK

+UULOC: 20/11/2023,18:34:07.000,40.0000000,-4.0000000,0,958000
Location: 40.0000000, -4.0000000
Altitude: 0m
Accuracy: +/- 958000m

AT+ULOC=2,2,0,1,1

OK

+UULOC: 20/11/2023,18:34:17.000,40.0000000,-4.0000000,0,958000
Location: 40.0000000, -4.0000000
Altitude: 0m
Accuracy: +/- 958000m


How can I prevent it from asking for my PIN?
I don't care if my SIM has a pin.

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