Network Connection on XBee 3 Cellular NB-IoT

Hello everyone,
Hope you're all doing great during these difficult times...

I'm working with an XBee 3 Cellular LTE-M/NB-IoT , trying to set it up with NB-IoT connection in Brazil.

Currently, I'm using the most basic setup possible to ensure that there are no problems with my Arduino's code, so I'm using default XBee's micropython until I get it to work.

Problem

Or the module returns NETWORK_REG_FAILURE or it just keep as REGISTERING_TO_NETWORK and nothing happens.keeps

Hardware

I'm currently with an XBIB-U-Dev and using a W3554B0140 PulseLarsen Antenna.

Software

As I said before, I'm trying to isolate errors and use as much default code provided by Digi as possible to avoid problems on my end as I'm unable to get it working.
I'm using just XCTU and Pycharm 2020.3.5 with Digi's extension.

import time
import xbee

AI_DESC = {
    0x00: 'CONNECTED',
    0x22: 'REGISTERING_TO_NETWORK',
    0x23: 'CONNECTING_TO_INTERNET',
    0x24: 'RECOVERY_NEEDED',
    0x25: 'NETWORK_REG_FAILURE',
    0x2A: 'AIRPLANE_MODE',
    0x2B: 'USB_DIRECT',
    0x2C: 'PSM_DORMANT',
    0x2F: 'BYPASS_MODE_ACTIVE',
    0xFF: 'MODEM_INITIALIZING',
}

IP_PROTOCOL = {
    'UDP': 0,
    'TCP': 1,
    'SMS': 2,
    'Reserved': 3,
    'TCPSSL': 4,
}


def watch_ai(old_ai):
    """
    Monitors the value of the AI parameter. Whenever it changes it displays
    the new value.
    """
    new_ai = xbee.atcmd("AI")
    if new_ai != old_ai:
        print("- AI Changed!")
        print("   * New AI: 0x%02X (%s)"
              % (new_ai, AI_DESC.get(new_ai, "UNKNOWN")))

    return new_ai


def watch_db(old_db):
    """
    Monitors the value of the DB parameter. Whenever it changes it displays
    the new value.
    """
    new_db = xbee.atcmd("DB")
    if new_db != old_db:
        print("- DB:  {}".format(new_db))

    return new_db


print(" +-------------------------------------------+")
print(" | XBee MicroPython Connection Status Sample |")
print(" +-------------------------------------------+\n")

xbee.atcmd("AN", "myapn.com.br")
xbee.atcmd("CU", "user")
xbee.atcmd("CW", "pass")
xbee.atcmd("CP", 1) #Carrier Profile = No Profile
xbee.atcmd("BN", 0x10000000) #Set NB-IoT Bandmask
xbee.atcmd("N#", 3)  #Set NB-IoT only
xbee.atcmd("IP", IP_PROTOCOL.get('TCP'))


old_ai = -1
old_db = -1

while old_db != 0x00 and old_ai != 0x00:
    old_ai = watch_ai(old_ai)
    old_db = watch_db(old_db)

    time.sleep(1)

Code Output

 +-------------------------------------------+
 | XBee MicroPython Connection Status Sample |
 +-------------------------------------------+

- AI Changed!
   * New AI: 0x22 (REGISTERING_TO_NETWORK)
- DB:  None
- AI Changed!
   * New AI: 0xFF (MODEM_INITIALIZING)
- AI Changed!
   * New AI: 0x22 (REGISTERING_TO_NETWORK)
- DB:  105
- DB:  51
- DB:  69
- DB:  51
- DB:  69
- DB:  51
- DB:  69
- DB:  51

Sometimes I get NETWORK_REG_FAILURE.

Important Observations

I can read signal strength, however, the module doesn't seem able to read the SIM card phone number, but it does read the others like IMEI, IMSI, ICCID.

I also checked with the SIM card company and they reassured me that the APN, Bandmask, user, and password are right.

XCTU Image

Reference

Configure your module for cellular connectivity (digi.com)

Put the SIM card in a mobile phone and see if you can send/receive calls or SMS messages.

See https://www.quora.com/Do-all-SIM-cards-come-with-a-phone-number
Whilst SIM cards can store the phone numbers of your contacts, they don't store your own phone number.

Thank you for the tip. I placed it in my smartphone and it did manage to call other people. The SMS is blocked by default in the contract given that it is only to be used with network through the NB-IoT bands.

When testing in the smartphone, it connected using 4G and exchanged around 200kB after I turned the mobile connection off again, as my data is 10MB for this SIM.

Can you try connecting to the module directly via a serial console and type the "AT" commands directly so you have realtime view of the response?

I honestly think this is the easiest way to debug "AT" command based modules, instead of using an intermediate device such as your development board. Just make sure you got the voltages correct on both module and your USB-to-serial converter