Sodaq UBee LTE-M and other u-blox LTE-M Modules topic
- Introduction
- Manufacturer Documentation
- Modem Constructor
- Example Code
- LTE Network Selection
- Reference
- Detailed Descriptions
Introduction
There are a multitude of boards available that feature a variant of the u-blox SARA R4 series, including a Sodaq UBee.
The default baud rate for the SARA R410M is 115200. It DOES NOT save baud rate to non-volatile memory. After every power loss, the module will return to the default baud rate of 115200. This library attempts to compensate by sending a baud rate change command in the wake function. Because of this, 8MHz boards, LIKE THE MAYFLY, MUST use a HardwareSerial instance as modemSerial. This requirement does not exist for 16MHz (and faster) boards. For those, any Stream instance may be used.
Power draw is just about 500mA. A larger supply is (strongly) preferred.
Manufacturer Documentation
The module datasheet and AT commands for the SARA R4 series are available here: https:/
Modem Constructor
Construct a new Sodaq UBee R410M object. 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. For the Sodaq UBee, this is the pin labeled
SodaqUBeeR410M::
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.
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.
ON/OFF
; pin 9 on the bee socket. The fact that this pin controls the power to the u-blox module is not clear in the Sodaq documentation.
Should be set to a negative number if the modem status pin cannot be read. This is the pin labeled V_INT
in the u-blox integration guide. It is (misleadingly) called CTS
in some of the Sodaq UBee documentation because Sodaq wired the V_INT
from the u-blox to the pin usually reserved for CTS
on the bee socket.
Should be set to a negative number if the modem reset pin is not connected to the MCU. This is the pin labeled RESET_N
in both u-blox and Sodaq documentation.
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 is the pin labeled PWR_ON
in both u-blox and Sodaq documentation.
Example Code
Creating the Modem Object
The SARA R410M based UBee is used in the menu a la carte example.
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.
Classes
- class SodaqUBeeR410M
- The loggerModem subclass for the LTE-M Sodaq UBee based on the u-blox SARA R410M LTE-M cellular module. This can be also used for any other breakout of the the u-blox R4 or N4 series modules.
Modem Pin Settings and Timing
The timing and pin level settings for a Sodaq UBee R410M
- #define R410M_STATUS_LEVEL = HIGH
- The loggerModem::
_statusLevel. - #define R410M_STATUS_TIME_MS = 0
- The loggerModem::
_statusTime_ms. - #define R410M_RESET_LEVEL = LOW
- The loggerModem::
_resetLevel. - #define R410M_RESET_PULSE_MS = 10000L
- The loggerModem::
_resetPulse_ms. - #define R410M_WAKE_LEVEL = LOW
- The loggerModem::
_wakeLevel. - #define R410M_WAKE_PULSE_MS = 200
- The loggerModem::
_wakePulse_ms. - #define R410M_WAKE_DELAY_MS = 250
- The loggerModem::
_wakeDelayTime_ms. - #define R410M_ATRESPONSE_TIME_MS = 4500L
- The loggerModem::
_max_atresponse_time_ms. - #define R410M_DISCONNECT_TIME_MS = 15000L
- The loggerModem::
_disconnetTime_ms.
Define documentation
#define R410M_STATUS_LEVEL = HIGH
#include <src/modems/SodaqUBeeR410M.h>
The loggerModem::
V_INT
on the SARA R4 becomes active mid-way through on-pulse so it should be instantly visible
Status should be monitored on the V_INT
pin
#define R410M_STATUS_TIME_MS = 0
#include <src/modems/SodaqUBeeR410M.h>
The loggerModem::
V_INT
on the SARA R4 becomes active mid-way through on-pulse so it should be instantly visible
Status should be monitored on the V_INT
pin
#define R410M_RESET_LEVEL = LOW
#include <src/modems/SodaqUBeeR410M.h>
R4 series are reset with a >10 SECOND low pulse on the RESET_N
pin
#define R410M_RESET_PULSE_MS = 10000L
#include <src/modems/SodaqUBeeR410M.h>
The loggerModem::
R4 series are reset with a >10 SECOND low pulse on the RESET_N
pin
#define R410M_WAKE_LEVEL = LOW
#include <src/modems/SodaqUBeeR410M.h>
The SARA R410M is switched on by a 0.15-3.2 second LOW
pulse on the PWR_ON
pin
#define R410M_WAKE_PULSE_MS = 200
#include <src/modems/SodaqUBeeR410M.h>
The loggerModem::
The SARA R410M is switched on by a 0.15-3.2 second LOW
pulse on the PWR_ON
pin
#define R410M_WAKE_DELAY_MS = 250
#include <src/modems/SodaqUBeeR410M.h>
The loggerModem::
Time after power on before PWR_ON
on SARA R4 can be used is nclear in documentation! Using 250ms.
#define R410M_ATRESPONSE_TIME_MS = 4500L
#include <src/modems/SodaqUBeeR410M.h>
The loggerModem::
Time until system and digital pins on SARA R4 are operational is ~4.5s.
#define R410M_DISCONNECT_TIME_MS = 15000L
#include <src/modems/SodaqUBeeR410M.h>
The loggerModem::
Power down time for u-blox modules "can largely vary depending on the
application / network settings and the concurrent module activities." The V_INT
pin should be monitored and power not withdrawn until that pin reads low. We allow up to 15 seconds for shutdown in case it is not monitored.