Digi XBee® Cellular LTE-M/NB-IoT topic

Introduction

When operated in Digi's "bypass" mode, the u-blox SARA R410M based XBee3 can be implented as a DigiXBeeLTEBypass object - a subclass of DigiXBee and loggerModem. Bypass refers to the fact that XBee3's main processor is bypassed - acting only as a pass-through to the u-blox cellular component.

This LTE-M module can just about almost get by with only 500mA power supplied, but it definitely not ideal.

Manufacturer Documentation

The Digi product page for the LTE-M module is here: https://www.digi.com/products/embedded-systems/digi-xbee/cellular-modems/xbee3-cellular-lte-m-nb-iot

Modem Constructor

DigiXBeeLTEBypass::DigiXBeeLTEBypass(Stream* modemStream, int8_t powerPin, int8_t statusPin, bool useCTSStatus, int8_t modemResetPin, int8_t modemSleepRqPin, const char* apn)

Construct a new Digi XBee LTE Bypass object.

Parameters
modemStream The Arduino stream instance for serial communication.
powerPin The digital pin number of the mcu pin controlling power to the modem (active HIGH).
statusPin The digital pin number of the mcu pin connected to the modem status output pin.
useCTSStatus True to use the CTS_N/DIO7 pin of the XBee as a status indicator rather than the true status (ON/SLEEP_N/DIO9) pin. This inverts the loggerModem::_statusLevel.
modemResetPin The digital pin number of the pin on the mcu attached the the hard or panic reset pin of the modem.
modemSleepRqPin The digital pin number of a pin on the mcu used to request the modem enter its lowest possible power state.
apn The Access Point Name (APN) for the SIM card.

The constuctor initializes all of the provided member variables, constructs a loggerModem parent class with the appropriate timing for the module, calls the constructor for a TinyGSM modem on the provided modemStream, and creates a TinyGSM Client linked to the modem.

Should be set to a negative number if the modem should be continuously powered or the power cannot be controlled by the MCU. Should be set to a negative number if the modem status pin cannot be read. This can be either the pin named ON/SLEEP_N/DIO9 or CTS_N/DIO7 pin in Digi's hardware reference. Should be set to a negative number if the modem reset pin is not connected to the MCU. This shold be the pin called RESET_N in Digi's hardware reference. Should be set to a negative number if there is no pin usable for deep sleep modes or it is not accessible to the MCU. This shold be the pin called DTR_N/SLEEP_RQ/DIO8 in Digi's hardware reference.



Example Code

Creating the Modem Object

The digi_cellular is used in the menu a la carte example.

1// For the u-blox SARA R410M based Digi LTE-M XBee3
2// NOTE: According to the manual, this should be less stable than transparent
3// mode, but my experience is the complete reverse.
4#include <modems/DigiXBeeLTEBypass.h>
5
6// NOTE: Extra hardware and software serial ports are created in the "Settings
7// for Additional Serial Ports" section
8const int32_t modemBaud = 9600; // All XBee's use 9600 by default
9
10// Modem Pins - Describe the physical pin connection of your modem to your board
11// NOTE: Use -1 for pins that do not apply
12// The pin numbers here are for a Digi XBee with a Mayfly 0.x and LTE adapter
13const int8_t modemVccPin = A5; // MCU pin controlling modem power
14const int8_t modemStatusPin = 19; // MCU pin used to read modem status
15// NOTE: If possible, use the `STATUS/SLEEP_not` (XBee pin 13) for status, but
16// the CTS pin can also be used if necessary
17const bool useCTSforStatus = false; // Flag to use the CTS pin for status
18const int8_t modemResetPin = 20; // MCU pin connected to modem reset pin
19const int8_t modemSleepRqPin = 23; // MCU pin for modem sleep/wake request
20const int8_t modemLEDPin = redLED; // MCU pin connected an LED to show modem
21 // status
22
23// Network connection information
24const char* apn = "xxxxx"; // APN for GPRS connection
25
26// Create the modem object
27DigiXBeeLTEBypass modemXBLTEB(&modemSerial, modemVccPin, modemStatusPin,
28 useCTSforStatus, modemResetPin, modemSleepRqPin,
29 apn);
30// Create an extra reference to the modem by a generic name
31DigiXBeeLTEBypass modem = modemXBLTEB;

LTE Network Selection

It is good practice to select which network you'll be connecting to based on your SIM card and signal availability. Example code for this can also be found in the menu a la carte example.

1 // Extra modem set-up
2 Serial.println(F("Waking modem and setting Cellular Carrier Options..."));
3 modem.modemWake(); // NOTE: This will also set up the modem
4 // Turn off the cellular radio while making network changes
5 modem.gsmModem.sendAT(GF("+CFUN=0"));
6 modem.gsmModem.waitResponse();
7 // Mobile Network Operator Profile - 0 = SW default
8 // - 1 = SIM ICCID selected
9 // - 2: ATT
10 // - 6: China Telecom
11 // - 100: Standard Europe
12 // - 4: Telstra
13 // - 5: T-Mobile US
14 // - 19: Vodafone
15 // - 3: Verizon
16 // - 31: Deutsche Telekom
17 modem.gsmModem.sendAT(GF("+UMNOPROF="), 2);
18 modem.gsmModem.waitResponse();
19 // Selected network technology - 7: LTE Cat.M1
20 // - 8: LTE Cat.NB1
21 // Fallback network technology - 7: LTE Cat.M1
22 // - 8: LTE Cat.NB1
23 // NOTE: As of 2020 in the USA, AT&T and Verizon only use LTE-M
24 // T-Mobile uses NB-IOT
25 modem.gsmModem.sendAT(GF("+URAT="), 7, ',', 8);
26 modem.gsmModem.waitResponse();
27 // Restart the module to apply changes
28 modem.gsmModem.sendAT(GF("+CFUN=1,1"));
29 modem.gsmModem.waitResponse(10000L);

Classes

class DigiXBeeLTEBypass
The class for any of Digi's cellular LTE-M XBee3 modules operating in Digi's "bypass" mode.