MKR 1500 NB Hangs on nbAccess.begin()

So a few a days ago I received my MKR1500NB + antenna + battery and started experimenting with it.

So I removed it from the foam, put in a SIM Card (which supports NarrowBand / LTE-M network in my country), installed the MKRNB library + drivers in the desktop IDE, as per instruction and fired up some examples, starting with the TestModem script.

Note: in the below testing I have disabled the battery and tried multiple power sources for USB, I have not seen a difference.

Initially this did not work and gave me the "Error: Could not get IMEI" message, only after I added a 90 second delay at the start of the loop() did it actually present me with a proper IMEI number. Seemingly the modem has a wake up time ?

Now to continue I opened and uploaded the "ChooseRadioAccessTechnology" example, and selected option 3 to prefer NB IoT with LTE-M as fallback. This all seemed to work from what I could tell (the selection of the band that is).

Now when it comes to actually trying to use connectivity, none of it works.
I loaded up the "GPRSUdpNtpClient" example, which from what I can tell just hangs after some point in the process (through Serial monitor)
The moment the command "nbAccess.begin(PINNUMBER)" is called, the arduino sketch freezes and fails to progress. ( I have tried adding the same 90 second delay here to no avail )

When enabling Debug Output on the NB object the following debug output is given:

Starting Arduino GPRS NTP client.
AT
OK
AT+CMEE=0
OK
AT+CFUN=0
OK
AT+CPIN?
+CPIN: READY
OK
AT+CMGF=1
OK
AT+UDCONF=1,1
OK
AT+CTZU=1
OK
AT+CGDCONT=1,"IP",""
OK
AT+UAUTHREQ=1,0
OK
AT+CFUN=1
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0
OK
AT+CEREG?
+CEREG: 0,0

the last 3 lines then loop forever.

From my understanding +CEREG: 0,0 , effectively means no network is found to register on.

I'm not sure if my board is bad, or maybe the sim card is bad, either way it seems strange the entire sketch just hangs and fails to progress. Based on the examples it seems like unexpected behavior. I've read other posts where this behavior was related to insufficient power source, but I do not believe this to be the case. ( I tested on 4 different power sources which I know provide the required 2.1A )

If anyone has some advice I'd love to hear it.

Thanks in advance.

Please make sure that your sim is not locked with a PUK number. Try to put it in a phone and double-check it first.

Hi @racpra16

in the AT log above you see the lines

AT+CPIN?
+CPIN: READY

According the the AT manual from Ublox, the response means:
"READY: MT is not pending for any password"

So the sim should be good.

Hello,

Yes ... this is frustrating. The exact same place I am stuck. This is the first Arduino product I have bought that doesn't just work.

I work with dozens of these cellular modules on a daily basis. I'm shocked that Arduino doesn't seem to have a basic "pass through" sketch that they provide that allows for basic AT Command testing to verify operation of the modem. I've seen one talked about, but can' seem to find it.

Scott

There is a SerialSARAPassthrough sketch on my setup in Arduino/libraries/MKRNB/examples/Tools. It took me a while to find it. Hop that helps.

Just a sidenote; it will take some time to register the device on the network if it's the first time it's being connected. Your issue might be related to the Ublox (have you checked the timeout on nbClient?), but I've created a custom PCB based on this board and for each new SIM card I probably have to try to connect for 4-5 minutes before the SIM is registered.

Hello,

same issue here.
I'm not able to connect to the NB network. I tried with the SerialSARAPassthrough but nothing changed.
PIN is disabled and the debug looks like this:

NB IoT/LTE Cat M1 networks scanner
AT

OK
AT

OK
AT+CMEE=0

OK
AT+CFUN=0

OK
AT+CPIN?

+CPIN: READY

OK
AT+CMGF=1

OK
AT+UDCONF=1,1

OK
AT+CTZU=1

OK
AT+CGDCONT=1,"IP","ep.inetd.gdsp"

OK
AT+UAUTHREQ=1,0

OK
AT+CFUN=1

OK
AT+CEREG?

+CEREG: 0,0

OK
AT+CEREG?

+CEREG: 0,0

OK

Someone here that can help to configure/connect?

I'm running this code:

/*
#include <MKRNB.h>

NB nbAccess(true);
NBScanner scannerNetworks;
NBModem modemTest;

String IMEI = "";
String errortext = "ERROR";

void setup() {
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

Serial.println("NB IoT/LTE Cat M1 networks scanner");
scannerNetworks.begin();

// connection state
boolean connected = false;

while (!connected) {
if (nbAccess.begin("","ep.inetd.gdsp") == NB_READY) {
connected = true;
Serial.println("Connected");
} else {
Serial.println("Not connected");
delay(1000);
}
}

// get modem parameters
// IMEI, modem unique identifier
Serial.print("Modem IMEI: ");
IMEI = modemTest.getIMEI();
IMEI.replace("\n", "");
if (IMEI != NULL) {
Serial.println(IMEI);
}
}

void loop() {
// currently connected carrier
Serial.print("Current carrier: ");
Serial.println(scannerNetworks.getCurrentCarrier());

// returns strength and ber
// signal strength in 0-31 scale. 31 means power > 51dBm
// BER is the Bit Error Rate. 0-7 scale. 99=not detectable
Serial.print("Signal Strength: ");
Serial.print(scannerNetworks.getSignalStrength());
Serial.println(" [0-31]");

// scan for existing networks, displays a list of networks
Serial.println("Scanning available networks. May take some seconds.");
Serial.println(scannerNetworks.readNetworks());
// wait ten seconds before scanning again
delay(10000);
}

Can you gime me some advices?

Thank you so much in advance.

I've struggled with the same thing. Please note that nbAccess.begincalls ModemClass::begin()in the file MODEM.h/MODEM.CPP, and ModemClass::begin() contains a fatal error: It does not reset the modem in the correct way, and the code may in fact permanently damage the SARA R410 modem.

This is the issue:

My quick workaround was to change ModemClass::begin in MODEM.cpp to the following:

int ModemClass::begin(bool restart)
{
  _uart->begin(_baud > 115200 ? 115200 : _baud);

  // always keep RESET_N pin low
  digitalWrite(_resetPin, LOW);
  pinMode(_resetPin, OUTPUT);

  // powerOn pin should be LOW during normal operation
  digitalWrite(_powerOnPin, LOW);
  pinMode(_powerOnPin, OUTPUT);
  delay(1000);

  // powerOn pin should be driven HIGH for 0.15 - 1.5 sec to initiate power on sequence
  if (restart) {
    digitalWrite(_powerOnPin, HIGH);
    delay(1000);
    digitalWrite(_powerOnPin, LOW);
    delay(6000);
  } else {
    if (!autosense()) {
      return 0;
    }

    if (!reset()) {
      return 0;
    }
  }

  if (!autosense()) {
    return 0;
  }

  if (_baud > 115200) {
    sendf("AT+IPR=%ld", _baud);
    if (waitForResponse() != 1) {
      return 0;
    }

    _uart->end();
    delay(100);
    _uart->begin(_baud);

    if (!autosense()) {
      return 0;
    }
  }

  return 1;
}

Also, the code for ModemClass::end is buggy. To avoid ModemClass::end possibly bricking your SARA R410 device, just do this:

void ModemClass::end()
{
  _uart->end();
  // digitalWrite(_resetPin, HIGH);
  // power off module
  // digitalWrite(_powerOnPin, LOW);
}

Maybe this helps!

1 Like

Just checking in. Has anyone found a solution for this? Did I make a mistake getting the 1500? I'm getting the same issue. However, I can run the TestModem tool, which works fine. Any updates on a solution would be greatly appreciated.

It appears that the issue from above, Library use of POWER_ON and RESET_N · Issue #47 · arduino-libraries/MKRNB · GitHub, has been solved recently. I had to clone the master branch of the repo manually. By the way, I still can't get this to work. I'm also using a hologram sim card.