ModularSensors > Modules > Supported Modems and Communication Modules > Digi XBee's > Digi XBee® Cellular 3G

Digi XBee® Cellular 3G module

Introduction

When operated in Digi's "bypass" mode, the u-blox SARA U201 based 3G XBee with 2G fallback can be implented as a DigiXBee3GBypass 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.

The 3G module must have 2 amps of power available.

Manufacturer Documentation

The Digi product page for the 3G module is here: https://www.digi.com/products/embedded-systems/cellular-modems/digi-xbee-cellular-3g

Modem Constructor

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

Construct a new Digi XBee 3G 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). Should be set to a negative number if the modem should be continuously powered or the power cannot be controlled by the MCU.
statusPin The digital pin number of the mcu pin connected to the modem status output pin. 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.
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. 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.
modemSleepRqPin The digital pin number of a pin on the mcu used to request the modem enter its lowest possible power state. 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.
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.



Example Code

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

// For the u-blox SARA U201 based Digi 3G XBee with 2G fallback
// NOTE:  According to the manual, this should be less stable than transparent
// mode, but my experience is the complete reverse.
#include <modems/DigiXBee3GBypass.h>

// NOTE: Extra hardware and software serial ports are created in the "Settings
// for Additional Serial Ports" section
const int32_t modemBaud = 9600;  // All XBee's use 9600 by default

// Modem Pins - Describe the physical pin connection of your modem to your board
// NOTE:  Use -1 for pins that do not apply
// The pin numbers here are for a Digi XBee with a Mayfly and LTE adapter
const int8_t modemVccPin    = A5;  // MCU pin controlling modem power
const int8_t modemStatusPin = 19;  // MCU pin used to read modem status
// NOTE:  If possible, use the `STATUS/SLEEP_not` (XBee pin 13) for status, but
// the CTS pin can also be used if necessary
const bool   useCTSforStatus = false;  // Flag to use the CTS pin for status
const int8_t modemResetPin   = 20;     // MCU pin connected to modem reset pin
const int8_t modemSleepRqPin = 23;     // MCU pin for modem sleep/wake request
const int8_t modemLEDPin = redLED;     // MCU pin connected an LED to show modem
                                       // status

// Network connection information
const char* apn = "xxxxx";  // APN for GPRS connection

// Create the modem object
DigiXBee3GBypass modemXB3GB(&modemSerial, modemVccPin, modemStatusPin,
                            useCTSforStatus, modemResetPin, modemSleepRqPin,
                            apn);
// Create an extra reference to the modem by a generic name
DigiXBee3GBypass modem = modemXB3GB;

Classes

class DigiXBee3GBypass
The loggerModem subclass for Digi Cellular XBee's based on u-blox SARA U201 chips and operated in bypass mode.

Defines

#define TINY_GSM_MODEM_UBLOX
The modem type for the underlying TinyGSM library.