MKR NB 1500 Connection Issues

Hi all,

I am currently trying to get the MKR NB 1500 up and running using LTE-M for a school project. I am using a Hologram Global 3 SIM card and this antenna:
https://www.l-com.com/wireless-antenna-cellular-wifi-multi-band-flexible-fpcb-embedded-antenna

The modem example works fine, and I was able to set my protocol to CAT M1 using the RAT example. I am running into issues using the NBScanNetwork example where I cannot connect to the service. I changed the APN to include "hologram" and these are what my APN commands read:

NB IoT/LTE Cat M1 networks scanner
AT

OK
AT+CPWROFF

OK
AT

OK
AT+CMEE=0

OK
AT+CFUN=0

OK
AT+CPIN?

ERROR
AT+CPIN?

+CPIN: READY

OK
AT+CMGF=1

ERROR
Not connected
AT+CPWROFF

OK
AT

OK
AT+CMEE=0

OK
AT+CFUN=0

OK

I am not sure if it is a software or hardware issue. Also, my SARA module firmware is L0.0.00.00.05.12,A.02.21. Can anyone help me troubleshoot what the problem may be? Thank you!

Miraculously, it seems the board is now working. I can see that it is connected to Hologram as well.

Now I have a new issue. I cannot send SMS out. The program says that it was sent, but I am not receiving anything on my phone. I have tried +1 and 001 in front of the number. Anything else it could be?

I had similar issues yesterday, seems restart SARA-R410 module (or power cycling the whole board) helped.
As for the SMS I am a little bit clueless at the moment. What does debugging say?

Enabling debug:

NB nbAccess(true);
Elaborating details about SARA-R410 restart

GPRSUdpNtpClient.ino does not start.
Data-SIM only, verified to function with cell phone, PIN code disabled.

Starting Arduino GPRS NTP client.
AT
OK
AT+CMEE=0
OK
AT+CFUN=0
OK
AT+CPIN?
ERROR
AT+CPIN?
ERROR
// ...

With a endless AT+CPIN? ERROR loop, where the NB / Modem is not able to come out of it.
Also tried SIM back to phone, setting PIN code, same result.

TestModem.ino works fine.

Had ChatGPT to make a modified version of SerialSARAPassthrough.ino with some AT commands to get information.

/*
   SerialSARAInfoReader sketch

   This program sends AT commands to the SARA-R410 and retrieves
   useful information about the modem and SIM card at startup.

   Requirements:
   - MKR NB 1500
   - Antenna
   - SIM card

   Make sure the Serial Monitor is set to "Both NL and CR".

   Based on SerialSARAPassthrough by Sandeep Mistry.
*/

// Baud rate for Serial and SerialSARA
unsigned long baud = 115200;

void setup() {
  pinMode(SARA_RESETN, OUTPUT);
  digitalWrite(SARA_RESETN, LOW);

  // Power-on pulse
  pinMode(SARA_PWR_ON, OUTPUT);
  digitalWrite(SARA_PWR_ON, HIGH);
  delay(150);
  digitalWrite(SARA_PWR_ON, LOW);

  Serial.begin(baud);
  while (!Serial);  // Wait until Serial is ready
  SerialSARA.begin(baud);
  delay(1000);

  Serial.println("Starting SARA-R410 Modem Information Retrieval...");
  delay(2000);

  queryModemInfo();
}

void loop() {
  if (Serial.available()) {
    SerialSARA.write(Serial.read());
  }

  if (SerialSARA.available()) {
    Serial.write(SerialSARA.read());
  }
}

void sendATCommand(const char* command, unsigned long timeout) {
  SerialSARA.println(command);
  Serial.print(">> ");
  Serial.println(command);

  unsigned long startTime = millis();
  while (millis() - startTime < timeout) {
    if (SerialSARA.available()) {
      Serial.write(SerialSARA.read());
    }
  }
  Serial.println();
}

void queryModemInfo() {
  Serial.println("Fetching modem and SIM information...");

  sendATCommand("AT+CFUN=15", 2000);  // Full reset
  delay(5000);  // Wait for restart

  sendATCommand("ATI", 2000);           // Module identification
  sendATCommand("AT+GMM", 2000);        // Model name
  sendATCommand("AT+CGMI", 2000);       // Manufacturer
  sendATCommand("AT+CGMR", 2000);       // Firmware version
  sendATCommand("AT+CSQ", 2000);        // Signal strength
  sendATCommand("AT+CREG?", 2000);      // Network registration status
  sendATCommand("AT+COPS?", 2000);      // Current network operator

  sendATCommand("AT+CCID", 2000);       // SIM card ID (ICCID)
  sendATCommand("AT+CIMI", 2000);       // IMSI (International Mobile Subscriber Identity)
  sendATCommand("AT+CPIN?", 2000);      // SIM card status (ready or PIN required)
  sendATCommand("AT+CPIN=xxxx", 2000);      // SIM card status (ready or PIN required)
  sendATCommand("AT+QSPN", 2000);       // Service provider name

  sendATCommand("AT+CGPADDR", 2000);    // Check IP address
  sendATCommand("AT+CGATT?", 2000);     // Check network attachment status
  sendATCommand("AT+UPSND=0,8", 2000);  // Internet connection status
}

Serial Monitor:

Starting SARA-R410 Modem Information Retrieval...
Fetching modem and SIM information...
>> AT+CFUN=15
AT+CFUN=15

OK

>> ATI
ATI

Manufacturer: u-blox
Model: SARA-R410M-02B
Revision: L0.0.00.00.05.12 [Mar 09 2022 17:00:00]
SVN: 09
IMEI: <long number here>

OK

>> AT+GMM
AT+GMM

SARA-R410M-02B

OK

>> AT+CGMI
AT+CGMI

u-blox

OK

>> AT+CGMR
AT+CGMR

L0.0.00.00.05.12 [Mar 09 2022 17:00:00]

OK

>> AT+CSQ
AT+CSQ

+CSQ: 99,99

OK

>> AT+CREG?
AT+CREG?

+CME ERROR: SIM failure

>> AT+COPS?
AT+COPS?

+CME ERROR: SIM failure

>> AT+CCID
AT+CCID

+CCID: <long number here>

OK

>> AT+CIMI
AT+CIMI

+CME ERROR: SIM failure

>> AT+CPIN?
AT+CPIN?

+CPIN: SIM PIN

OK

>> AT+CPIN=xxxx
AT+CPIN=xxxx

OK

>> AT+QSPN
AT+QSPN

ERROR

>> AT+CGPADDR
AT+CGPADDR

+CGPADDR: 1,0.0.0.0

OK

>> AT+CGATT?
AT+CGATT?

+CGATT: 0

OK

>> AT+UPSND=0,8
AT+UPSND=0,8

ERROR

AT command set is defined in 3GPP Technical Standard 27.007

I recently had trouble receiving SMS on my MKR NB 1500. I found that clearing the modem memory saved the day. The command that worked for me was AT+CMGD=0,4. See LEXI-R4 and SARA-R4 AT Command Manual for the different flags you can set.

If you include the MKRNB library in your project then you have access to MODEM.

int clear_messages()
{
  String at_response;
  MODEM.send("AT+CMGD=0,4");
  if (MODEM.waitForResponse(5000, &at_response) != 1)
  {
    return 1;
  }
  else
  {
    return 0;
  }
}
1 Like