Go Down

Topic: NB MKR 1500 - modem testing (Read 6779 times) previous topic - next topic



Just another update. Sometimes the modem is working and I'm able to shoot AT commands at it. Right now I can do the following (using the SerialSARAPassthrough example):

14:47:04.168 -> AT

14:47:04.168 -> OK
14:47:27.582 -> AT+CGMI

14:47:27.582 -> u-blox
14:47:27.582 ->
14:47:27.582 -> OK
14:47:42.427 -> AT+CGMM

14:47:42.427 -> SARA-R410M-02B
14:47:42.427 ->
14:47:42.427 -> OK
14:47:56.218 -> AT+CFUN=1

14:47:56.218 -> OK
14:48:06.603 -> AT+CFUN?

14:48:06.603 -> +CFUN: 1
14:48:06.603 ->
14:48:06.603 -> OK
14:48:49.375 -> AT+CEREG?

14:48:49.375 -> +CEREG: 0,0
14:48:49.375 ->
14:48:49.375 -> OK
14:49:00.441 -> AT+CEREG?

14:49:00.441 -> +CEREG: 0,0
14:49:00.441 ->
14:49:00.441 -> OK
14:49:28.456 -> AT+CGSN

14:49:28.456 -> <correct IMEI removed by sejersbol>
14:49:28.456 ->
14:49:28.456 -> OK
14:49:49.656 -> AT+COPS?

14:49:49.656 -> +CME ERROR: SIM failure
14:51:36.581 -> AT+CIMI

14:51:36.581 -> +CME ERROR: SIM failure
14:51:47.494 -> AT+CGMI

14:51:47.494 -> u-blox
14:51:47.494 ->
14:51:47.494 -> OK
14:53:17.223 -> AT+COPS=?

14:53:17.223 -> +CME ERROR: SIM failure

It looks like a SIM cards failure. However I have inserted the SIM correctly AFAIK. I have a Nano SIM inserted in a Micro SIM converter - chip connectors facing the board and the cut corner towards IO pin 6/7.

I have tried to remove and reinsert the the SIM with no luck.

Kind regards,

Anders Sejersbøl.


Feb 25, 2019, 03:12 pm Last Edit: Feb 25, 2019, 03:15 pm by sejersbol
I just tried the NTP example with "NB nbAccess(true);" and I got some AT output. I said that there was a SIM card failure... hmmm. However I did not catch the output log at first try and when I tried again it had stoped working (no output at all). This is so frustrating...

UPDATE: Got it working again after some tries. Now I get:

15:14:23.084 -> Starting Arduino GPRS NTP client.
15:14:33.407 -> Not connected
15:14:44.695 -> Not connected
15:14:45.781 -> AT

15:14:45.781 -> OK
15:14:45.923 -> AT+CPIN?

15:14:45.923 -> +CME ERROR: SIM not inserted
15:14:46.101 -> AT+CPIN?

15:14:46.101 -> +CME ERROR: SIM not inserted
15:14:46.318 -> AT+CPIN?

15:14:46.318 -> +CME ERROR: SIM not inserted
15:14:46.525 -> AT+CPIN?

15:14:46.525 -> +CME ERROR: SIM not inserted


Hi guys !

@jamessh, thanks for trying the code.

At least its good to share the pain, i was starting getting paranoid...

I will also give the NTP and SerialSARAPassthrough example a try.

If i remember correctly, the boards are available only since around November 2018, are we having some early adopter issues here ?
Mouser has it only for some weeks now.
I found something more at the Hologram community relating to the buginess of the board and some hints about power consumption/the board only running correctly with additional battery attached.



Hi all,

I also had some problems with the example sketches. I found some challenges with my APN and band configurations by using SerialSARAPassthrough example sketch. I edited the sketch a bit by adding some useful AT commands. Below you can find my debugging tool ->

Code: [Select]

   DebugATCommandsSARA sketch

   This sketch is modified from SerialSARAPassthrough.

   The sketch allows you to send 15 basic AT commands from the USB CDC serial port
   of the MKR NB 1500 board to the onboard ublox SARA-R410 celluar module.

   If you want to add more commands the list of supported AT commands are found here:

   - MKR NB 1500 board
   - Antenna
   - 1500 mAh or higher lipo battery connected recommended
       - USB seems to have enough power (tested with my PC)
   - SIM card

   Make sure the Serial Monitor's line ending is set to "Both NL and CR"

   create 26 February 2019
   Tomi Sarajisto

// baud rate used for both Serial ports
unsigned long baud = 115200;
char command;

void setup() {
  // reset the ublox module
  digitalWrite(SARA_RESETN, HIGH);
  digitalWrite(SARA_RESETN, LOW);


void loop() {
  if (Serial.available()) {
    command = Serial.read();
    switch (command)
      case '0':
        Serial.println("m: Set verbose error resultcodes");
      case '1':
        Serial.println("1: Check IMEI");
      case '2':
        Serial.println("2: Check IMSI");
      case '3':
        Serial.println("3: Check RAT type config");
      case '4':
        Serial.println("4: Check band configuration");
      case '5':
        Serial.println("5: Check signal");
      case '6':
        Serial.println("6: Check APN configuration");
      case '7':
        Serial.println("0: Check network");
      case '8':
        Serial.println("a: Check all available networks (takes long time)");
      case '9':
        Serial.println("j: Define PDP context");
      case 'a':
        Serial.println("k: Activate PDP context 1");
      case 'b':
        Serial.println("i: Show address of the PDP contexts");
      case 'c':
        Serial.println("n: Open UDP socket");
      case 'd':
        Serial.println("o: Send packet to Ublox's echo server ");
        SerialSARA.println("AT+USOST=0,\"echo.u-blox.com\",13,16,\"16 bytes of data\"");
      case 'e':
        Serial.println("p: Read data from UDP socket");
      case 'f':
        Serial.println("g: Display current configuration");

        // add your own AT commands



  if (SerialSARA.available()) {


Below you can see my configurations ->

13:28:34.754 -> 1: Check IMEI
13:28:34.754 -> AT+GSN

13:28:34.754 -> 35275......             //edited
13:28:34.754 ->
13:28:34.754 -> OK
13:28:35.569 -> 2: Check IMSI
13:28:35.569 -> AT+CIMI

13:28:35.569 -> 23820.....                //edited
13:28:35.569 ->
13:28:35.569 -> OK
13:28:36.346 -> 3: Check RAT type config
13:28:36.346 -> AT+URAT?

13:28:36.346 -> +URAT: 8
13:28:36.346 ->
13:28:36.346 -> OK
13:28:37.432 -> 4: Check band configuration
13:28:37.432 -> AT+UBANDMASK?

13:28:37.432 -> +UBANDMASK: 0,132,1,132
13:28:37.466 ->
13:28:37.466 -> OK
13:28:38.217 -> 5: Check signal
13:28:38.217 -> AT+CSQ

13:28:38.217 -> +CSQ: 16,99
13:28:38.217 ->
13:28:38.217 -> OK
13:28:38.895 -> 6: Check APN configuration
13:28:38.928 -> AT+CGDCONT?

13:28:38.928 -> +CGDCONT: 1,"IP","lpwa.telia.iot","",0,0,0,0
13:28:38.928 -> +CGDCONT: 2,"IP","lpwa.telia.iot","",0,0,0,0
13:28:38.928 ->
13:28:38.928 -> OK
13:28:40.995 -> 0: Check network
13:28:41.030 -> AT+COPS?

13:28:41.030 -> +COPS: 0,0,"Sonera Telia",9
13:28:41.030 ->
13:28:41.030 -> OK
13:28:52.785 -> j: Define PDP context
13:28:52.785 -> AT+CGDCONT=1,"IP","lpwa.telia.iot"

13:28:52.819 -> OK
13:28:56.311 -> k: Activate PDP context 1
13:28:56.311 -> AT+CGACT=1,1

13:28:56.311 -> OK
13:28:59.397 -> i: Show address of the PDP contexts
13:28:59.397 -> AT+CGPADDR

13:28:59.397 -> +CGPADDR: 1,
13:28:59.397 -> +CGPADDR: 2,
13:28:59.397 ->
13:28:59.397 -> OK
13:29:01.643 -> n: Open UDP socket
13:29:01.677 -> AT+USOCR=17

13:29:01.677 -> +USOCR: 0
13:29:01.677 ->
13:29:01.677 -> OK
13:29:03.435 -> o: Send packet to Ublox's echo server
13:29:03.469 -> AT+USOST=0,"echo.u-blox.com",13,16,"16 bytes of data"

13:29:04.619 -> +USOST: 0,16
13:29:04.619 ->
13:29:04.619 -> OK
13:29:04.855 ->
13:29:04.855 -> +UUSORF: 0,26
13:29:09.081 -> p: Read data from UDP socket
13:29:09.081 -> AT+USORF=0,26

13:29:09.081 ->
13:29:09.081 -> +USORF: 0,"",13,26,"26 FEB 2019 12:29:04 CET
13:29:09.115 -> "
13:29:09.115 ->
13:29:09.115 -> OK

You can add your own AT commands easily...



I have now tested both with and without a battery connected (LI-PO 503562 1200 mAh) and I definitely see much better stability with a battery connected. However, there is still problems. When I run the TestModem example sketch the IMEI is correctly returned about 80-90% of the time. I do not understand why it does not always work. I have tried adding delay()'s, but can't find a solution that makes it work 100% of the time.

Also, I have SIM card issues that I can't explain:

10:46:59.160 -> AT+COPS?

10:46:59.160 -> +CME ERROR: SIM failure

The SIM card (Nano SIM in Micro SIM converter) is working without any problems in another NB-IoT modem.


I've been fighting getting the MKR NB 1500 to work consistently, and still don't know the answer.  But after dozens of modem test failures to get the IMEI number, I decided to reboot my computer, and the modem test finally started working again.  Then re-ran the RAT and it worked.  Trying network scanner, which worked before, and it is holding at "NB IoT/LTE Cat M1 networks scanner".  I'm going to walk away for a while and see if it will eventually connect and scan.  Hopefully someone with the OEM will give us some guidance soon???  Hard to work on our own sketches until we can get their tools working consistently.
 Cheers, Steve.


Mar 01, 2019, 12:46 pm Last Edit: Mar 01, 2019, 01:20 pm by MadMadHoosier
  I can no longer get either of the two MKR NB 1500 boards I purchased from mouser to succeed with any of the example sketches - even the simple modem test.  It returns:

Starting modem test...ERROR, no modem answer.
Checking IMEI...Error: Could not get IMEI

  So I'm giving up on them for now, and ordered two SparkFun LTE Cat M1/NB-IoT Shields.  While looking at the SparkFun shields, they offer a button on the shield that turns the modem on/off, independent of the processor.
 Now, even though they do not offer an external on/off switch, I wonder if one of the sketches I've played with inadvertently turned the modem off internally on the MKR boards.  An exhaustive search on the internet has not revealed any documentation that shows if that is even possible.
  So until some people smarter than me (many), figure out the quirks, I'm just wasting a lot of time. And that's a shame, because the size and expected capabilities of the MKR NB is perfect for several projects I have in mind. 
Cheers, Steve.


Hi !

In the meantime i also purchased a LiPo accu and finally made some progress.

Attaching a battery was the only way to get the modem up and responding to AT commands.


Even if after using NBRAT tutorial I got the same experience. Which IDE version you are using? I am getting different error for different IDE version:

for 1.6.9 : SAM-BA operation failed and Status halt as Uploading state.
for 1.8.8 : An error occurred while uploading the sketch.

Can you please share your expertise?


I added this code to reset the Ublox modem in the setup code. After that just upload the code and everything is working again.

  // enable the POW_ON pin
  digitalWrite(SARA_PWR_ON, HIGH);

  // reset the ublox module
  digitalWrite(SARA_RESETN, HIGH);
  digitalWrite(SARA_RESETN, LOW);


I added this code to reset the Ublox modem in the setup code. After that just upload the code and everything is working again.

  // enable the POW_ON pin
  digitalWrite(SARA_PWR_ON, HIGH);

  // reset the ublox module
  digitalWrite(SARA_RESETN, HIGH);
  digitalWrite(SARA_RESETN, LOW);

This worked for me aswell. Only had to be run on the board once though. Could be the sara-chip was in a bad state and needed a reset?



i had a lot more fun using a LoRa dev kit recently.

Maybe i will give the MKR 1500 another try, but the documentation and code examples are a dissapointment.

Go Up