SARA-R41 Application Development Guide
SARA-R41 Application Development Guide
SARA-R4
Abstract
This document provides detailed technology architecture and examples of how to use AT commands
with u-blox SARA-R4 series modules.
UBX-18019856 - R13
C1-Public [Link]
SARA-R41 series - Application note
Document information
Title SARA-R41 series
Subtitle Application development guide
Document type Application note
Document number UBX-18019856
Revision and date R13 08-Jul-2022
Disclosure restriction C1-Public
In development / Objective specification Target values. Revised and supplementary data will be published later.
Prototype
Engineering sample Advance information Data based on early testing. Revised and supplementary data will be published later.
Initial production Early production information Data from product verification. Revised and supplementary data may be published later.
Mass production / Production information Document contains the final product specification.
End of life
u-blox or third parties may hold intellectual property rights in the products, names, logos and designs included in this
document. Copying, reproduction, modification or disclosure to third parties of this document or any part thereof is only
permitted with the express written permission of u-blox.
The information contained herein is provided “as is” and u-blox assumes no liability for its use. No warranty, either express or
implied, is given, including but not limited to, with respect to the accuracy, correctness, reliability and fitness for a particular
purpose of the information. This document may be revised by u-blox at any time without notice. For the most recent
documents, visit [Link].
Copyright © u-blox AG.
Contents
Document information ................................................................................................................................ 2
Contents .......................................................................................................................................................... 3
1 Introduction ............................................................................................................................................. 8
2 LPWAN technology overview ............................................................................................................ 9
2.1 LTE Cat M1 ................................................................................................................................................... 9
2.2 NB-IoT ............................................................................................................................................................ 9
3 Application design and development........................................................................................... 10
3.1 Initial design decisions .............................................................................................................................10
3.2 Application stages ....................................................................................................................................11
3.2.1 Persistent configurations ...............................................................................................................11
3.2.2 Power on/boot/PSM exit ..................................................................................................................11
3.2.3 Network registration ........................................................................................................................11
3.2.4 IP acquisition......................................................................................................................................11
3.2.5 Core application ................................................................................................................................12
3.2.6 Power-off ............................................................................................................................................12
3.3 Application modes ....................................................................................................................................12
3.3.1 Debug / test mode ............................................................................................................................12
3.3.2 Production testing ............................................................................................................................12
3.3.3 Certification mode ............................................................................................................................12
3.3.4 Firmware update mode ...................................................................................................................12
4 Power-on/off sequence ..................................................................................................................... 13
4.1 Power-on .....................................................................................................................................................13
4.1.1 Checking SIM status at boot ..........................................................................................................13
4.2 Power-off ....................................................................................................................................................14
5 AT command response parser ........................................................................................................ 15
5.1 Unsolicited result code.............................................................................................................................15
5.2 Best practices ............................................................................................................................................16
6 Port selection ....................................................................................................................................... 17
6.1 AT interface ................................................................................................................................................17
6.1.1 Interface power saving ....................................................................................................................17
6.2 Multiplexer implementation (UART) .....................................................................................................17
6.2.1 DLCI mapping (channel support) ...................................................................................................17
6.2.2 Limitations .........................................................................................................................................18
6.3 RING indication ..........................................................................................................................................18
7 MNO profiles......................................................................................................................................... 19
7.1 Using MNO profiles ...................................................................................................................................19
7.1.1 MNO profile 0 (undefined) ...............................................................................................................20
7.1.2 MNO profile 1 (SIM ICCID select) ...................................................................................................20
7.1.3 MNO profile 100 (Standard Europe) .............................................................................................21
7.1.4 MNO profile 101 (Standard Europe No-ePCO) ...........................................................................21
1 Introduction
This document provides guidance for developing applications with LTE Cat M1 and NB-IoT
technologies. It includes examples of AT commands used to interface with the u-blox SARA-R4 series
modules for network connectivity.
Table 1 shows a summary of the documentation available for SARA-R4 series modules.
Document name Notes
Application integration Application development guide app note This document. Start here!
FW update app note [4] FW update procedures (uFOTA, FOAT, FOTA,
+UFWINSTALL, EasyFlash).
IoT Security-as-a-Service overview [10] IoT-as-a-Service features (local encryption, E2E
encryption, E2E symmetric KMS, Chip-to-Chip,
Zero Touch Provisioning).
GNSS implementation app note[5] GNSS interface and aiding clients. Techniques for
hybrid positioning and timing indication.
Mux implementation app note[6] Usage of multiplexer with cellular modules.
LwM2M objects and commands[7] LwM2M objects and relevant AT commands
EVK-R4 user guide [8] Starting guide for the SARA-R4 evaluation kit.
Reference documentation Data sheet [1] Use these documents as hardware integration
and AT commands API reference.
System integration manual [3]
AT commands manual [2]
Product release documents Sample Delivery Note / Information Note Delivered with every FW release.
Table 1: SARA-R4 series documentation overview
See the SARA-R4 series AT commands manual [2] for detailed AT command descriptions.
The following symbols are used to highlight important information within this document:
☞ An index finger points out key information pertaining to module integration and performance.
⚠ A warning symbol indicates actions that could negatively impact or damage the module.
2.2 NB-IoT
Narrowband IoT (NB‑IoT), also known as LTE Cat NB1, is a Low Power Wide Area (LPWA) technology
that works virtually anywhere. It simply and efficiently connects devices on already established mobile
networks, and securely and reliably handles small amounts of infrequent two‑way data. And the best
is, it provides:
• Very low power consumption
• Excellent extended range in buildings and underground
• Easy deployment into existing cellular network architecture
• Network security & reliability
• Lower component cost
NB‑IoT will connect many more devices to the Internet of Things and make many new applications a
reality. It is optimized for applications that need to communicate small amounts of data over long
periods of time. Since it operates in licensed spectrum, it is secure and reliable, providing guaranteed
quality of service.
Persistent
Power-on IP Power-off
configuration Registration Core application
boot acquisition PSM
(do it once)
Maintenance
Production Certification Debug / test
Normal mode (FW update)
mode mode mode
mode
server or can implement alternative or additional methods to implement FW updates when triggered,
for example by prolonged out of service conditions or by specific events.
Similar considerations hold for the security client.
Power saving features (+UPSV, PSM, eDRX) shall be configured based on the target power
consumption profile. See section 6.1.1 and 18 for more details.
The MNO profile (section 7) to be used depends on the type of application and SIM card (regional or
global roaming). If the SIM card belongs to an MNO for which the module has gained the type approval,
the MNO profile is available in the FW and shall be used.
Debug-ability can be provided via test endpoints, access to the USB interface, and in general a prolific
application log containing all AT commands strings exchanged with the module and diagnostic
information sent by the module with timing information.
☞ See the SARA-R4 FW update application note [4] for persistence of settings after a FW update. If
settings are not retained, they shall be reapplied as per section 3.2.2.
☞ When using PSM, at exit from low power mode the volatile settings as well as the current
communication port mode (MUX, dialup) shall be restored too.
3.2.4 IP acquisition
Once the module is registered, for LTE Cat. M1 and NB-IoT it then automatically attempts to establish
PDN connectivity and active PDP context with the network. Once PDP context is on a SIM account
that is subscribed to a data plan, IP is then available. For 2G connectivity on SARA-R412M, after
registration the PDP context must be manually activated by the host with the +CGACT AT command.
3.2.6 Power-off
When the application needs to switch off the module, be sure to follow the proper shutdown
procedures as described in the SARA-R4 series system integration manual [3].
4 Power-on/off sequence
See the SARA-R4 series system integration manual [3] which contains important information about
how to power on and off the module.
4.1 Power-on
When the SARA-R4 series modules are in the not-powered mode (i.e., the VCC module supply is not
applied), they can be switched on by a rising edge on the VCC input pins to a valid voltage level, and
then a low logic level needs to be set at the PWR_ON input pin for a valid time.
When the SARA-R4 series modules are in the power-off mode (i.e., switched off) with a valid VCC
supply applied, they can be switched on by a low pulse on the PWR_ON pin for a valid time period.
When the SARA-R4 series modules are in Power Save Mode (PSM), with a valid VCC supply still
applied, they can be switched on by a low pulse on the PWR_ON pin for a valid time period.
☞ Before the SARA-R4 series module is fully ready to operate, the host application processor should
not send any AT command over AT communication interfaces (USB, UART) of the module.
☞ The duration of the SARA-R4 series modules’ switch-on routine can vary depending on the
application / network settings and the concurrent module activities.
☞ The host application can use the +CSGT AT command to configure a known greeting text after the
module boot to tell when the AT interface is operational.
☞ The host application can use the +UGPIOC AT command to configure a GPIO pin to denote when
the AT interface is operational.
☞ Both “Module Status Indication” enabled by +UGPIOC and +CSGT greeting text feature, the internal
SIM controller may not be ready after either feature indicates the module is ready with AT
command interface available.
If an error result code is returned from such a command such as +CPIN, then the host could poll the
module with the same command until it returns a response indicating the SIM controller is initialized
and ready. As an example with the +CPIN AT command and a SIM that is not PIN-locked, after module
boot-up and when the AT interface becomes available, the host would then poll every 100 ms or longer
until +CPIN: READY is returned.
4.2 Power-off
SARA-R4 series modules can be cleanly switched off by:
• +CPWROFF AT command
• Low pulse on the PWR_ON pin for a valid time period
• Module going into the PSM
An abrupt under-voltage shutdown occurs on SARA-R4 series modules when the VCC module supply
is removed or when a low level is applied on RESET_N pin. If this occurs, it is not possible to perform
the storing of the current parameter settings in the module’s non-volatile memory or to perform the
clean network detach.
⚠ Currently the only way to know when to remove VCC is to monitor V_INT pin and wait until it is at
0 V.
⚠ An abrupt removal of the VCC supply during SARA-R4 series modules normal operations may lead
to an unrecoverable faulty state and must be avoided.
⚠ Forcing a low level on the RESET_N pin during SARA-R4 series modules normal operations may
lead to an unrecoverable faulty state and must be avoided.
6 Port selection
6.1 AT interface
SARA-R4 series modules automatically detect which interface is being used for AT commands. If the
USB interface is present by means of the VUSB_DET pin, then the USB interface is used for AT
commands. Otherwise, the UART interface is used for AT commands.
The module requires about 4 to 5 seconds to boot before the AT interface is available to the
application processor.
The GPIO pins can be configured for “Module operation status indication”, which is an indicator of
when the module has fully booted up and ready for AT commands. Issue the +UGPIOC AT command to
configure which GPIO pin is used for this indication. See the SARA-R4 series system integration
manual [3] for further details.
☞ Add USB test points to PCB design. This is critical to allow for other logging tools beyond m-center,
and to provide the ability to flash the module via EasyFlash.
☞ It is recommended to use a minimal of 40 ms for waking up the AT interface when in low power idle
mode with the power saving enabled.
When in low power idle mode, the module still switches to the active mode when it is required to listen
to the paging channel of the current base station. In between the module switches back to low power
idle mode.
To enable and disable the power saving feature the host application should use the +UPSV AT
command. See the SARA-R4 series system integration manual [3] for further information about
power saving using the +UPSV AT command.
6.2.2 Limitations
The multiplexer implementation has the following limitations:
• 9600 b/s baud rate is not supported.
• When an AT command (except ATD) is sent on the channel 1, the application must wait for a
response prior to sending another AT command on any other channel and vice versa.
• For commands such as +URDFILE and +USODL, that do not return “OK” right away, the application
must wait for the command to finish execution and return the “OK” final result code prior to
sending another AT command on any other channel and vice versa.
• When ATD is sent on the channel 1 and displays “CONNECT” intermediate result code, the
application may proceed to send another AT command on any other channel and vice versa.
• When a dial-up call is active on the channel 1, the application cannot use any AT commands that
require data services on any other channel. This includes FTP, HTTP, and sockets.
• The +CMUX command cannot be used again once the multiplexer has been enabled.
• The UART baud rate cannot be changed after the multiplexer enabling, so the +IPR command
should be used to set the desired baud rate prior to using the +CMUX command.
• The software flow control (Xon/Xoff) is not supported and should be disabled.
• Multiplexer power control and wake-up mechanism (as described in the 3GPP 27.010 TS [15]) are
not supported.
• The multiplexer is supported only on the UART interface. Only one interface can be used at a time.
• If direct link mode +USODL is used on one channel, then AT commands functionality over any other
channels will not be available.
• The RI indication for an incoming SMS through the MUX MSC message is not supported.
• When the MUX is used, the URC to indicate when an incoming SMS is received is not supported.
☞ When the module is in PSM, the RING indication will not be emitted.
☞ The GPIO can also be configured to note when the AT interface is ready. This can be used to detect
when the module has been woken up from PSM. See the +UGPIOC AT command description for
further information.
7 MNO profiles
Mobile Network Operator (MNO) profiles provides with a powerful and flexible method to configure the
SARA-R4 module to seamlessly work with the selected operator.
Using the MNO profiles the SARA-R4 module is dynamically configured to use the proper bands,
RATs, power saving parameters, eDRX parameters and the operator-dependent protocol stack
settings needed to operate on the selected network in full compliance with the operator requirements.
With the MNO profiles, customer application is not required to configure the module using complex
and/or network-dependent parameters, but benefits from a “out of the box” solution that provides
seamless connectivity while abstracting the complexity of managing individual network
configurations. MNO profiles are decoupled from the module firmware and therefore can be
dynamically updated (for example in case of network parameters change) – even after deployment –
without the need of updating the modem firmware.
In addition, generic MNO profiles are provided to provide full module configurability to the
applications.
Use the +UMNOPROF AT command to select a profile for the network operator.
SARA-R4 modules certified for specific operators should use the corresponding MNO profile to meet
operator requirements for which it was certified. For example, if a SARA-R410M-52B is certified for
the AT&T network the host application should set the +UMNOPROF to the corresponding AT&T profile.
☞ To view the list of available MNO profiles, use the +UMNOPROF test command.
☞ Use AT+UMNOPROF=,1 to enable the version text of the profile when they are listed using the above
command. For more details, see the SARA-R4 series firmware update application note [4].
⚠ For use on other networks that are not listed, if it is available on the product, use the MNO profile
100 (standard European) and configure RATs and bands accordingly.
This section covers some MNO profiles that are made available on certain products. For the list of
MNO profiles available on each of the product types and their settings for that product, see the
SARA-R4 series AT commands manual [2].
☞ Reboot the module with the AT+CFUN=15 command to make the MNO profile active.
☞ The previous setting may also include MNO profile 0. Use AT+UMNOPROF=1 to enable SIM ICCID
select mode.
See Appendix C for IIN values stored in lookup database.
The AT+UMNOPROF=1 behavior differs between products. For more details, see the three tables below.
SARA-R410M-02B-00,SARA-R410M-52B-00,SARA-R412M-02B-00, SARA-R412M-02B-01,
SARA-R412M-02B-02
Command Response Description
AT+UMNOPROF=1 OK Select the SIM ICCID select mode.
Insert or switch to different SIM.
AT+CFUN=15 OK Reset the device.
The device will reboot twice.
AT+UMNOPROF? +UMNOPROF: 2 Upon the module boot-up check the carrier profile that
OK has been set.
Changing binding mode with Docomo LwM2M DM server when <MNO>=20 profile used
Command Response Description
AT+ULWM2MSTAT=1 OK Enable the LwM2M URCs.
AT+CFUN=15 OK Perform a reset. This is to catch any
URCs from LwM2M client from boot-up.
+ULWM2MSTAT: 1, 123, 2 Wait for notification of LwM2M
bootstrap completed.
AT+ULWM2MWRITE="{\"bn\":\"/1/0/\" OK Modify the DoCoMo server instance by
,\"e\":[{\"n\":\"7\",\"sv\":\"UQ\ setting binding mode to "UQ”.
"}]}"
AT+ULWM2MSTAT=0 OK As an option, the host can perform this
step to disable LwM2M URCs
☞ Per MNO requirements, it is required by DoCoMo when using SARA-R410M-63B-01 with MNO 20
to change the binding mode as described in the above to support DoCoMo DM server.
☞ LwM2M is disabled by default for the DoCoMo profile. If a user should subscribe to DoCoMo
LwM2M services, then DoCoMo will permit the LwM2M client to be turned on via AT+ULWM2M=4.
If the LwM2M service subscription is later terminated, cancelled, or discontinued, then the host
must disable the LwM2M client with AT+ULWM2M=3 per DoCoMo’s requirement.
☞ Use +CNUM and +CGDCONT AT read commands to view the MDN number and APN assigned after
the module has registered on the network. (Not all network operators assign an MDN.)
☞ Use the +COPS AT read command to view the network information, and the +CESQ AT command
to check the signal conditions.
☞ If the SIM card is locked with a PIN, then the LwM2M client may not be properly configured, since
it will not be able to retrieve SIM information. This is most relevant in Verizon MNO profile
(+UMNOPROF: 3) where the SIM information is used to build the DUT endpoint name. It is then
recommended to insert the SIM PIN, if enabled, within 10 s of the module boot.
⚠ Configure the module to the desired MNO profile for it to function properly on the network it is
intended to be used on. Set the MNO profile on the very first use, or after flashing new firmware.
⚠ Applications shall select a proper MNO profile and not leave the factory-programmed undefined
profile.
☞ LTE Cat M1 and NB1 both have individual band masks, which need to be configured separately.
AT+UBANDMASK=0,<band mask> for LTE Cat M1, AT+UBANDMASK=1,<band mask> for NB1.
When using network simulators, to perform certain types of measurements there may be a need to
stay in local RRC connected state. See section 21.2 for details for guidance to disable the timer in
such situations.
☞ For standard European operation when the MNO is not listed, use MNO profile 100.
After setting the MNO profile the application may modify the Radio Access Technology priority and
band mask.
Possible reason for setting +URAT may include:
• Radio Access Technology is not deployed by the network carrier yet in the area device is intended
to run on. Therefore, only enabling the desired RAT will reduce the scan time when the device is
searching for the network.
Possible reason for setting +UBANDMASK may include:
• Band(s) is not deployed by the carrier yet in the area device is intended to run.
• The device is an area where it is interested in running on specific bands only.
• Reducing the number of bands will reduce the scan time when the device is searching for the
network.
Below is an example of going through the above steps in configuring the SARA-R4 module:
Step #1: Set the profile to standard Europe
Command Response Description
AT+UMNOPROF=100 OK Set the carrier profile to standard Europe.
AT+CFUN=15 OK Reset the device to make setting effective.
AT+UMNOPROF? +UMNOPROF: 100 Upon boot-up check that the carrier profile is set
OK correctly.
For more details on the AT commands used in the example, see SARA-R4 series AT commands
manual [2].
☞ The AT+COPS=2/AT+COPS=0 registration cycle in roaming might trigger the full PLMN scan,
while the AT+CFUN=0/AT+CFUN=1 cycle will select the last registered PLMN without additional
scans.
Manual:
The AT+COPS=1,2,”PLMN”,<Act> command will do a specific manual PLMN search, the module will
try to attach to a cell and even if it is roaming, it will still get on to it if the PLMN matches. With the
manual AT+COPS=1, the module will reduce the scanning process as well. For e.g., if the user wants
to attach to a certain carrier like AT&T on LTE Cat. M1, a AT+COPS=1,2,“310410”,7 command may
be issued. The manual network selection will work faster and save battery by not waiting for module
do a complete scan and decide to get onto a network.
Issuing AT+UMNOPROF=100 and AT+URAT=7,8,9 (on SARA-R412M), the module will scan LTE Cat.
M1 (as first preferred), NB1 (as second preferred) and 2G (as third preferred). The module will get on
to LTE Cat. M1 first if available and only if there is no LTE Cat. M1signal, the module will search for
NB1 and only if there is no NB1 it will try to register on 2G RAT. If the module got on to a 2G network,
it would look out for LTE Cat. M1 once again only when it loses registration on 2G RAT and switch over
to LTE Cat. M1 while it is available or right away when 2G signal is lost.
☞ 2G networks in the USA have been decommissioned by some operators and may be completely
shut down by remaining operators by the end of 2022.
Some networks might reject the attach if the type of attach is not allowed. The +USVCDOMAIN AT
command can be set to CS+PS and the module can register to a valid network A (as supported by the
SIM), but then if the module loses network A and later finds a valid network B (as supported by the
SIM) that supports PS only, the module might not be able to attach to this network B. It is good to
check what type of attach is preferred by a network.
Reducing the number of bands to what bands are used in the USA, reduces module’s scan time, and
saves power. Bands available in the USA are 2,4,5,12,13.
To enable all US bands
Command Response Description
AT+UBANDMASK=0,6170 OK Setting LTE-M bands
AT+UBANDMASK=1,6170 OK Setting NB-IoT bands
AT+CFUN=15 OK Reset the device to make the
setting effective.
If the device has a MVNO SIM card, then the +UMNOPROF AT command can be set to <mno>=100
and the module can be reconfigured for some of the settings like +URAT, +UBANDMASK and
+USVCDOMAIN appropriately. To be more efficient, for an MVNO SIM that supports multiple network
operators it is recommended that the module use the manual selection (AT+COPS=1) and pick a
preferred target operator and not issue AT+COPS=0.
To get on to AT&T LTE Cat M1 only with +UMNOPROF: 100
Command Response Description
AT+COPS=2 OK Deregister with the network.
It is possible to issue AT+CFUN=0 or AT+CFUN=4
instead of the AT+COPS=2 command.
AT+UMNOPROF=100 OK Set the carrier profile to standard Europe.
AT+CFUN=15 OK Reset the device to make the setting effective.
AT+URAT=7 OK Set the RAT to LTE Cat M1 only.
AT+UBANDMASK=0,2074 OK Set LTE-M band mask to band 2, 4, 5, 12 only.
AT+USVCDOMAIN=2 OK Set the Type of Attach to CS+PS
AT+CPSMS=0 OK Disable PSM [optional]
AT+CEDRXS=0 OK Disable eDRX [optional]
AT+USIMSTAT=4 OK For multi IMSI MVNO SIM cards configure the
+UUSIMSTAT URC to report the (U)SIM toolkit
REFRESH proactive command result.
For more details, see section [Link].
AT+UCUSATA=4 OK For multi IMSI MVNO SIM cards, enable the
+UUSIMSTAT URC by the +UCUSATA AT command.
For more details, see section [Link].
AT+CFUN=15 OK Reset the device to make the setting effective.
AT+UBIP=1 OK Enable BIP indication near boot-up
AT+COPS=1,2,"310410",7 OK Manual registration to AT&T
The example shows how to configure the URC to indicate proactive REFRESH events
Command Response Description
AT+USIMSTAT=4 OK For multi IMSI SIM cards (typically MVNO SIM cards),
configure the +UUSIMSTAT URC to report (U)SIM
toolkit REFRESH proactive command result.
AT+UCUSATA=4 OK For multi IMSI SIM cards (typically MVNO SIM cards),
after setting +USIMSTAT, then use the +UCUSATA
AT command to enable +UUSIMSTAT URC.
If enabled, when there is an IMSI swap event, the SIM
applet will issue a REFRESH event and the host can
now be informed via the +UUSIMSTAT URC.
The +CIMI AT command can be used before and/or
after the +UUSIMSTAT URC to track active IMSI
used.
AT+CFUN=15 OK Reboot the module.
The example below shows how to monitor the IMSI with respect to (U)SIM toolkit REFRESH events
and to enable BIP indication per each boot.
Command Response Description
AT+CIMI 732123203818006 Upon boot check IMSI
AT+UBIP=1 OK Enable BIP indication near boot
+UUSIMSTAT: 9 +UUSIMSTAT URC indicates (U)SIM toolkit
+UCUSATA: 4 REFRESH event.
OK
AT+CIMI 234500029813106 Check if IMSI has changed. In this example, it has.
OK
☞ If the uFOTA is enabled and needs to contact the uFOTA server when running on 2G, the LwM2M
will automatically activate the default context.
☞ +CREG is used to describe if the module has been registered in the Circuit Switched Domain too for
Combined Attach modes.
8.4 Mobility
This section describes the procedures of the module when it moves out of range of the currently
serving cell. This could mean entering another cell or moving into an area where there is no cellular
coverage.
If the module loses the synchronization with the serving cell but finds another cell of the same RAT to
camp on, any PDP context and open sockets will be kept. This holds in particular for seamless change
of serving cell with cell reselection or handover procedures.
If the application has configured multiple RATs in the +URAT setting, in case the module cannot select
a cell on the same RAT, it will automatically go through a re-selection process selecting a cell of
another RAT. In this case, PDP contexts will be locally deactivated and socket connections
disconnected accordingly.
☞ Currently only SARA-R4 series “63” / “73” version modules support Connected Mode Mobility.
SARA-R4 series modules will automatically try to connect when they boot. In this case it will be
scanning band 20 only for NB-IoT network. The host application can poll to see when the module has
registered and activated its default PDP context like this:
Command Response Description
AT+CEREG? +CEREG: 0,2 Module is still scanning
OK
AT+CEREG? +CEREG: 0,5 Registered to network (roaming)
OK
AT+CGATT? +CGATT: 0 Module is not attached to network yet
OK
AT+CGATT? +CGATT: 1 Module is attached to network
OK
AT+CGACT? +CGACT: 1,0 Module does not yet have an active PDP context
OK
AT+CGACT? +CGACT: 1,1 Module now has an active PDP context
OK
AT+CGDCONT? +CGDCONT: 1,"IP","j2m2m","91.80 Module has an IP address
.104.82",0,0
OK
AT+USOCR=17 +USOCR: 0 Create a UDP socket. Socket ID 0 is returned
OK
AT+USOST=0,"[Link] +USOST: 0,2 Send 2 bytes to u-blox echo server
",7,2,"AB" OK
<wait for +UUSORF URC> +UUSORF: 0, 2 Socket ID 0 has 2 bytes to read
AT+USORF=0,2 +USORF: 0,"[Link]",7,2," Read back 2 bytes from socket ID 0
AB"
OK
AT+USOCL=0 OK Close socket ID 0
The SARA-R4 series modules will automatically try to connect when they boot. In this case it will be
scanning for a 2G connection. The host application can poll to see when the module has registered
and activated its default PDP context like this:
Command Response Description
AT+CGREG? +CREG: 0,2 Module is still scanning.
OK
AT+CGREG? +CREG: 0,5 Registered to network.
OK
AT+CGATT? +CGATT: 0 Module is not attached to network yet.
OK
AT+CGATT? +CGATT: 1 Module is attached to network.
OK
AT+CGACT? +CGACT: 1,0 2G networks will not automatically activate the PDP
OK context: it must be done this manually (in general).
AT+CGACT=1 OK Module now has an active PDP context.
AT+CGDCONT? +CGDCONT: 1,"IP","j2m2m","91.80 Module has an IP address.
.104.82",0,0
OK
AT+USOCR=17 +USOCR: 0 Create a UDP socket. Socket ID 0 is returned.
OK
AT+USOST=0,"[Link] +USOST: 0,2 Send 2 bytes to u-blox echo server.
",7,2,"AB" OK
<wait for +UUSORF URC> +UUSORF: 0, 2 Socket ID 0 has 2 bytes to read.
AT+USORF=0,2 +USORF: 0,"[Link]",7,2," Read back 2 bytes from socket ID 0.
AB"
AT+USOCL=0 OK Close socket ID 0.
1
For more details, see appendix B5 in SARA-R4 series AT commands manual [2].
Once the MNO profile has been set according to the SIM as described in the above process, then if the
SIM should change from one carrier to another (i.e., SoftBank SIM to DoCoMo SIM), the module will
repeat the above process.
☞ For SARA-R410M-63B-00, the firmware IIN internal database was populated on October 2019.
This database includes both MNO and MVNO (Mobile Virtual Network Operator) SIMs.
When booting-up the module in offline mode such as in airplane mode (+CFUN: 4), then to avoid a
potential conflict with LwM2M leading to an unexpected module reboot, it is recommended to set
disable LwM2M before exiting the airplane mode by setting the module to full functionality to MT
(+CFUN: 1). Following exit, reboot the module to restore LwM2M client.
9 Data delivery
SARA-R4 series modules support three different data delivery modes: IP, NON-IP (using either control
plane or user plane) and SMS.
To configure for IP or NON-IP, the host application must configure a PDP context using the +CGDCONT
AT command.
To send NON-IP data the host application must use the +CSODCP AT command. To receive NON-IP
data the host application must configure the data reporting URC with the +CRTDCP AT command. See
section 17 for further information.
☞ On the DoCoMo MNO profile of the SARA-R410M-63B product version, the APN must be manually
entered to register with the DoCoMo network.
☞ On SARA-R410M-02B-03, when the Verizon MNO profile is selected (+UMNOPROF: 3), the module
may not restore the last APN value to blank on CID1 after de-registering with network. It is
recommended that the host monitors the APN value to see if it needs to restore the APN to blank,
or change the APN if another APN is desired upon next registration, e.g., when a SIM, which uses
different APN, is inserted.
☞ On SARA-R4 "02B" product versions, only one PDP context can be active. Before another PDP
context can be activated the host application must deactivate the current PDP context.
10.3 Authentication
The authentication on APNs can be configured by using the +UAUTHREQ AT command.
AT+UAUTHREQ=<cid>,<authentication_type>,"password","username"
11 DUN/PPP
When a data call is initiated by means of the D* AT command, the module switches to the PPP mode
just after the CONNECT intermediate result code. The first step of the PPP procedure is the LCP
handshake. SARA-R4 modules will first request the CHAP authentication during LCP negotiation.
• The host can respond with null (empty) username and null (empty) password.
• If the host PPP rejects (Configure-Reject) authentication during any LCP phase, SARA-R4 does
not request any more authentication.
• If the host PPP NACKs (Configure-NAK) CHAP authentication during LCP negotiation, SARA-R4
will then request PAP authentication.
• If the host PPP NACKs (Configure-NAK) PAP authentication during LCP negotiation, SARA-R4 will
request No Auth.
Using dial command for establishing PPP connection: ATD*99***1# the ‘1’ in this example refers to
the first active PDP context returned by the +CGDCONT read command.
☞ For SARA-R410M-02B-00 and SARA-R410M-52B-00, to avoid conflict with the internal uFOTA
client service, the PPP operation should be entered within 30 s of the module boot. If the DUN/PPP
(ATD#99) establishment fails, the application should retry.
☞ If the LWM2M LifeTimer should expire during the middle of the module’s run time after boot a
DUN/PPP establishment will fail, and the application should retry.
☞ In regard to device security and data security for SARA-R4 “63” / “73” / “83” product versions, a
PPP/DUN call cannot be established when:
o The device attempts to connect to the u-blox security server to perform a bootstrap
o When a security heartbeat time expires and it attempts to connect to u-blox security service
server
o When the encryption / decryption feature attempts to connect to owner’s platform.
The DUN call should be retired if any of the above cases should be encountered.
For more details on device security and data security, see u-blox IoT Security-as-a-Service
overview [10].
For 2G RAT, on the SARA-R412M the PDP context will be activated by the uFOTA client and released
by the uFOTA client when the data call to the uFOTA server is complete. During this time, the PDP
context cannot be activated by the host via +CGACT nor can it deactivate the context that is
established by the uFOTA client. The host needs to monitor the PDP context upon the boot and start
the DUN call when the PDP context is not activated and available to be used.
☞ After the module has attached to the network the host can control the PDP context APN,
authentication and MTU sizes directly through PPP.
☞ For Windows dial-up the command ATX0 should be configured as the initialization string under
advanced properties of the modem.
☞ If the network throughput is less than the data sent from the host to the module (is limited by
uplink network resource/bandwidth), then a packet data loss may occur, even with hardware flow
control enabled. To avoid this issue do either or both:
o Reduce the baud rate used
o The host application can slow down data transfer by adding pauses between data payloads or
breaking up their payload and adding delay.
☞ When using MUX and PPP combined, toggling the DTR line does not terminate the PPP session
and return the device to the command mode. In this configuration, it is recommended that the
host terminates the PPP session, which can be done by sending LCP_TERM REQ. Another method
to terminate the PPP session is to send a MSC MUX frame for logical DTR de-assert.
If the PSM is enabled and the devices goes into RRC idle state due to inactivity of traffic over the
PPP link, the device will enter the PSM low power mode when the T3324 timer expires.
In the below example there are two contexts defined and established. The second context on CID2
may be utilized by PPP. Do not active the second context manually, instead establishing the PPP
session will automatically activate and deactivate it. In the example the second context is activated
by the PPP session.
For more details on multiple PDP contexts, see the SARA-R4 series AT commands manual [2].
☞ Setting the +CEREG <mode> parameter to 3, 4 or 5 it is possible to see the registration EMM cause
value. These values are described in the 3GPP TS 24.008 [13]. Typical causes:
o #5 IMEI not accepted
o #11 PLMN not allowed
o #12 Location area not allowed
o #13 Roaming not allowed in this location area
o #22 Congestion
☞ Use the +CGPADDR AT command to read what the IP address of the module has been set to.
The +CGDCONT AT command lists the IP addresses for each defined PDP context.
No IP addresses are displayed until the module has registered on the network and has been provided
with an IP address. The application could simply poll this IP address to see when the entire registration
process has finished.
⚠ Without a DNS address being assigned to the module by the network, uFOTA client will not
operate.
12.4 AT example
Below is example pseudo code that shows how to manage the registration process in the host
application.
Because the +COPS AT command does not provide a URC when the Radio Access Technology (RAT)
changes on registration, the host application should wait for “any” registration, and then read the RAT
from the +COPS <AcT> parameter:
// (assuming the module is not connected and not scanning i.e., +COPS: 2)
// Enable URCs
AT+CEREG=1
AT+CGREG=1
AT+CREG=1
13 TCP/UDP sockets
Basic communications to servers can be made using UDP or TCP. The host application will need to
create a socket, and through the socket send and receive data. Multiple sockets can be used at the
same time.
☞ If the module changes RAT any sockets opened at the time will be closed.
☞ Any open sockets will be kept open if the module loses the previous cell and can camp on another
cell without timing out scanning for the new cell.
☞ IPv4 is configured by default. If the host application is using IPv6, it must modify the IP type
parameter by means of the +UPSD AT command.
Command Response Description
AT+UPSD=0,0,1 OK Set profile 0, protocol IP type to IPv6
☞ For UDP it is possible to specify the listen port with the create socket command. If the listen port
is specified here, there is no need to use the +USOLI AT command. An error result code will be
returned if both procedures are tried.
It is possible to set the <async> parameter which allows the AT command to complete with the final
result code before the socket has actually closed. If the optional <async> parameter is used the
+UUSOCL URC will be issued when the socket has finally closed.
☞ Issue the +USOCLCFG AT command to enable or disable the closing of the TCP socket on the remote
system when the module is in idle mode. If enabled the module will re-establish the RRC connection
and send a message to the server closing the socket. When this is disabled the module will leave
the server’s socket open when it goes into idle mode.
☞ The +UUSOCL URC will not be issued if the remote host closes the socket until all the received data
has been read using the +USORD AT command.
Per TCP RFC 793 [17], the client can specify a “TIME_WAIT” value, commonly named as linger timer,
for the above socket closing process. Lowering this value could reduce the socket closure time, but by
doing so it would trade off time to ensure the last ACK is sent from the client to the server, where in
context the client is referred to as the initiator of the TCP session and the receiver is the server.
For SARA-R410M-02B-00, SARA-R410M-02B-01, SARA-R410M-52B-00, SARA-R410M-52B-01,
SARA-R412M-02B-00, SARA-R412M-02B-01, and SARA-R4 “63 / 73 / 83” product versions, the linger
timer default value is 30 s.
13.6 UDP
The UDP is a basic way of sending a message to an application server. There are no transport layer
acknowledgements for the message and there is no guarantee the message will arrive at the
destination. To add acknowledgements to these messages consider using CoAP messaging
externally on the MCU. A connection to a server is not needed when using UDP as the SendTo function
contains all the information required.
☞ The maximum length of data that can be sent at a time is 1024 bytes.
For direct link with UDP, if the network throughput is less than what the module is attempting to send
(is limited by uplink network resource/bandwidth), then a UDP packet data drop may occur, even with
hardware flow control enabled. To avoid this issue, do either or both:
• Reduce the baud rate used
• The host application can slow down data transfer by adding pauses between data payloads or
breaking up their payload and adding delay
The application should read this message and then read the data from the specified socket.
13.6.3 Testing
A simple way to test UDP sockets over the NB-IoT network is to send data to an echo server.
13.7 TCP
TCP uses transport acknowledgments between the module and the destination server. TCP will
automatically resend any lost packets and therefore is more robust than UDP.
The downside to using TCP is that there are more messages to be sent between the UE and network
and therefore will consume more power.
14 MQTT
SARA-R4 series modules can be configured to quickly and easily run the MQTT protocol. This section
provides the minimum configuration required to get the MQTT protocol up and running. There are two
different quick start techniques that can be used to quickly get to an MQTT connection (and
performing MQTT commands):
• Minimal MQTT configuration – it accepts the default values provided for MQTT configuration
• Saved MQTT configuration – it changes the MQTT configuration until it is acceptable and saving
it, thus allowing a quick restore to get back all of the MQTT configuration parameters
☞ This will overwrite all the MQTT profile parameters currently in the NVM.
☞ Do not execute this command if there is current active MQTT login connection. Otherwise, the
MQTT profile parameters for that connection will be lost.
Where the actual server's IP address substitutes for the "[Link]" placeholder in the example above.
Where the actual server's name substitutes for the "[Link]" placeholder used in the
example above. The module will use its internal DNS client for IP address resolution.
The command could be used to attempt to make an MQTT connection with the specified MQTT
remote server. If the connection is successful, depending on the product version, the MQTT remote
server will send either:
+UUMQTTC: 1,0 for SARA-R4 “02” / “52” product versions
+UUMQTTC: 1,1 for SARA-R4 “63” / “73” / “83” product versions
This indicates a successful login to an MQTT connection. Any non-zero connection result indicates
the MQTT server refused the MQTT login connection. Once an MQTT connection is established,
MQTT commands are available.
☞ The MQTT remote server must be specified (either by IP address or name) in the saved NVM
configuration for a connection to occur.
☞ This will overwrite all the MQTT profile parameters currently in memory, so it should not be
performed if there is currently an active MQTT login connection (since the MQTT profile
parameters for that connection will be lost). The restored MQTT profile parameters were
previously saved using the AT+UMQTTNV=2 command.
If the connection is successful, depending on the product version, the MQTT remote server will send
one of these URCs:
+UUMQTTC: 1,0 for SARA-R4 “02” / “52” product versions
+UUMQTTC: 1,1 for SARA-R4 “63” / “73” / “83” product versions
This indicates successful login to an MQTT connection. Any non-zero connection result indicates the
MQTT server refusing the MQTT login connection. Once an MQTT connection is established, MQTT
commands are available.
for that <Topic Filter> (indicating the MQTT server successfully subscribed the MQTT client to the
given <Topic Filter>), the MQTT server will send to the MQTT client every published message that
matches the given <Topic Filter>.
[Link] Example
The following command subscribes the MQTT client to all messages published that match the
"/user/ublox" Topic Filter:
AT+UMQTTC=4,0,"/user/ublox"
The MQTT server will send that MQTT message to every MQTT client connected to it that is
subscribed to a topic filter that matches the given topic name.
[Link] Example
The following command publishes the "Hi! ..." message to all the MQTT clients connected to the given
MQTT server whose topic filter subscriptions match the "/user/ublox" topic name:
AT+UMQTTC=2,0,0,"/user/ublox","Hi! This is an MQTT message."
After receiving the above notification, the host application can send the AT+UMQTTC=6 read command
to list the stored messages. The URC will be issued again, then the topic/message pairs.
SARA-R4 "02" / "52" product versions:
AT+UMQTTC=6
+UMQTTC: 6,1
OK
+UMQTTCM: 6,<Num_unread_msgs>
<topic_name>
<message>
<topic_name>
<message>
…
OK
☞ The format of the message output can be configured with AT+UMQTTC=7,<format> command.
On SARA-R4 "63” / “73" product versions, the read command syntax is:
AT+UMQTTC=6[,<one_message>]
Set the <one_message> parameter to the recommended value of 1 reads one received message at a
time:
AT+UMQTTC=6,1
+UMQTTC: 6,<QoS>,<topic_msg_length>,<topic_length>,<topic_name>,<read_msg_length>,<read
_msg>
OK
14.3.4 Logout
The following command terminates the MQTT connection:
AT+UMQTTC=0
After this command is issued, the MQTT connection to the MQTT remote server no longer exists.
Therefore, no MQTT commands (e.g., publish or subscribe) will work until another MQTT connection
is established.
Where the actual <Username> and <Password> replace the <Username>/<Password> placeholders
used in the example.
14.4.2 Client ID
The module attempts to create a default client ID for each module attempting to connect to an MQTT
server, uniquely based on the module's IMEI. It is important that this client ID is unique. Upon receiving
a new login connection, an MQTT server must disconnect any pre-existing connection using the same
client ID. Users may decide to create their own proprietary naming scheme to uniquely identify each
of their MQTT client modules. The following command specifies an MQTT client ID that must be
unique to the MQTT server:
AT+UMQTT=0,"<Unique_Client_ID>"
Where the actual client ID designation replaces the <Unique_Client_ID> placeholder used in the
example. The user may also be required to supply the client ID if the module fails to access its IMEI
and thus fails to create a default client ID.
Both of these commands are necessary to define a valid will message for the MQTT client.
2
Not supported on SARA-R4 "63" / "73" product versions
15 HTTP
HTTP profiles are used to define the remote server. The basic HTTP profile consists of a server name
or IP address and basic authentication (username, password). For HTTPS, the server private
certificate can be specified with USECMNG.
16 Secure data
16.1 Certificate format
SARA-R4 series modules do not support the PEM format. Only DER and CER formats are supported.
For a useful reference on how to convert certificates from PEM format, see the support SSL website.
+UUSORD: 0,10
AT+USORD=0,10 +USORD: 0,10,"1234567890" Read the decrypted data.
OK
AT+USOCL=0 OK Disconnects DTLS and close the socket.
17 Non-IP messaging
Using the Non-IP method of sending and receiving messages saves the overhead of needing to send
a UDP IP header. The UDP header is about 48-60 bytes in length, and so an application sending
100 bytes will send about 160 bytes.
Customers cannot use Non-IP messaging without enablement via the MNO. This is because there is
no destination IP address and therefore the MNO will either store these messages in their own IoT
platform, or will forward these messages on to another service. Either way the customer needs to
understand where these Non-IP messages will go.
To send a Non-IP message use the +CSODCP AT command.
☞ Attach type must be set to EPS only for using the +CSODCP AT command.
☞ T3324 and T3412 timers are assigned by the network. The application can request to the network
what timer values it wants, but the network does not need to grant these values.
UBX-18019856 - R13 Paging, eDRX, PSM and deep sleep mode Page 58 of 84
C1-Public
SARA-R41 series - Application note
18.1 eDRX
The 3GPP TS Release 13 introduced a new feature called Extended Discontinuous Reception (eDRX).
This allows the paging to only operate for a period and then again sometime later. In between the
paging windows the module is in deep sleep mode. eDRX operates while the T3324 timer is running
and is specified by several hyper frames (10.24 s).
The module can still receive downlink messages when it is in the T3324 period. These messages will
be cached by the network knowing the module will be awaken for the next paging window after the
eDRX cycle has completed.
☞ If the eDRX state is changed by enabling or disabling eDRX via +CEDRXS, a AT+CFUN=15 or proper
shut-down/power-up should be applied for eDRX to properly function.
☞ The application can read the network eDRX value using the AT+CEDRXRDP command.
☞ The direct link mode for both sockets and FTP should not be used with HW flow control and eDRX
all three combined together. This combination can lead to the module going into eDRX deep-sleep
during active direct link data transfer session to due potential HW flow control timing leading to
data not being able transfer smoothly and connection timeout.
☞ See sections 18.2.2 and 18.2.3 for how to set T3412 and T3324 values in +CPSMS AT command.
Power Save Mode (PSM) allows the device to skip the periodic page monitoring cycles between active
data transmissions. During this implementation, the device becomes unreachable when the PSM is
active, i.e., it will not be able to receive any downlink messages and any downlink messages sent from
the customers cloud application will be lost.
By implementing the PSM, an LTE NB-IoT device can remain in PSM state for as long as 413 days,
determined by the maximum value of the Tracking Area Update (TAU) timer.
UBX-18019856 - R13 Paging, eDRX, PSM and deep sleep mode Page 59 of 84
C1-Public
SARA-R41 series - Application note
During the PSM active state, all the HW components in the device are turned off, and the device will
not monitor page messages or perform any Radio Resource Management (RRM) measurements. The
only component that is running during PSM is the PMIC RTC.
PSM can enable more efficient low-power mode entry/exit, as the device remains registered with the
network and its state maintained during PSM, without having the need to spend additional cycles to
setup registration/attachment after each PSM entry/exit event.
On the SARA-R4 series modules, if the network supports PSM and grants PSM timers to the module
upon attach process or Tracking Area Update (TAU), then the PDP context is retained across PSM
cycles. Any PPP connections, sockets, or other connections must be re-established upon exiting the
PSM. Since the module is essentially in the off state when it goes into the PSM, the behavior is similar
to what would be expected if the module is turned off and turned it back on.
In practice, this makes sense because PSM cycles will typically be greater than 4 hours per GSMA
guidance, so sockets likely will be closed on the server side due to inactivity.
Any settings the host application has made will need to be re-configured again after waking up the
module. For example, ATE0, AT&S0, AT+CMEE, AT+CEREG. Only settings saved in the NVM according to
the SARA-R4 series AT commands manual [2] are kept in PSM.
When the host is using either of the following data services:
• UDP or TCP sockets
• HTTP/HTTPS
• FTP/FTPS
the device can enter the PSM mode during the data service session, if there is an idle period of data
transfer long enough for the network RRC timer to expire, thus releasing the RRC connection from the
network.
☞ For non-data service features such as a download file by means of the +UDWNFILE AT command
the device can enter the PSM during a file transfer.
To avoid interruption of the data service or other features from PSM, disable PSM via the +CPSMS
AT command, execute the desired data service, and when finished, enable PSM with the +CPSMS
AT command.
UBX-18019856 - R13 Paging, eDRX, PSM and deep sleep mode Page 60 of 84
C1-Public
SARA-R41 series - Application note
☞ To allow the PSM to correctly function and allow the module to wake up for a TAU, the minimum
recommended T3412 timer is 90 s, but timer values that are relatively short are not appealing for
power consumption and typically not recommended.
☞ NOTE 1: This timer value unit is only applicable to the T3312 extended value IE and the T3412
extended value IE (see 3GPP TS 24.301 [14]). If it is received in an integrity protected message,
the value shall be interpreted as multiples of 320 hours. Otherwise, the value shall be interpreted
as multiples of 1 hour.
☞ NOTE 2: This timer value unit is not applicable to the T3412 extended value IE. If this timer value
is received, the T3412 extended value IE shall be considered as not included in the message (see
3GPP TS 24.301 [14]).
UBX-18019856 - R13 Paging, eDRX, PSM and deep sleep mode Page 61 of 84
C1-Public
SARA-R41 series - Application note
In the default +UPSMVER: 15 setting, the module has been configured to be power efficient with PSM,
if the module is not granted PSM by the network, it will fall back into PSM without network
coordination. Without network coordination the module will enter PSM by detaching from the network
as soon as there is inactivity and stay in the sleep mode for 54 minutes. When it wakes from PSM
sleep mode, it will need to register with a network once again.
Also, it will periodically enter PSM if it cannot find a network to register on for any +UPSMVER setting.
☞ PDN context / IP address is not retained with PSM without network coordination.
The following is an example of when PSM is not granted by the network and then the module falls back
to PSM without network coordination.
Command Response Description
AT+UPSMVER? +UPSMVER: 15 Read the current +UPSMVER setting (15).
OK
AT+CPSMS=1,,,"00011101","00010101" OK Enabling the PSM and optionally set timers.
In this example: requesting timers are:
• 00011111: 310 minutes (5 hours 10 minutes) for
TAU
• 0001011: 22 s for active timer
AT+CSCON=1 OK Enable radio connection status if not enabled.
AT+UPSMR=1 OK Enable Power Saving Mode indication if not
enabled.
AT+CSGT=1,"Greeting Message" OK Optionally set a greeting message, which is the
text printed when it exists PSM sleep state.
AT+CFUN=15 OK Reboot to enable the PSM.
Greeting Message Greeting message after boot-up.
+CSCON: 1 RRC connection active.
AT+UPSMR? +UPSMR: 1 Check power saving mode indication enabled.
AT+CEREG=4 OK Optionally set the +CEREG mode for registration
status notification and format.
AT+CEREG? +CEREG: 4,1,"2809","29", Let device register
"9EBB01",7,,, The +CEREG read command is one method for an
on-demand check of the registration status and
PSM assigned settings.
AT+UCPSMS? +UCPSMS: 0 The +UCPSMS read command response provides
OK PSM assigned settings. In this case, PSM has not
been granted by the network..
+CSCON: 0 RRC goes idle.
+CSCON: 1 +CSCON indicates RRC is now active to detach
from network in this case, where in this example
sequence it appears right before +UUPSMR: 1
(next URC event below).
+UUPSMR: 1 URC indicating device going into PSM low power
mode.
The device enters PSM without network
coordination.
The key point in this example, is in the above two
URC events +CSCON: 1 appear right before
+UUPSMR:1. This indicates the network did not
grant PSM and therefore the T3324 timer does not
apply.
☞ This is the only way of checking the PSM has
not been granted on SARA-R410M-01B,
SARA-R410M-02B-01, SARA-R410M-02B-02,
SARA-R410M-02B-03, SARA-R410M-52B,
UBX-18019856 - R13 Paging, eDRX, PSM and deep sleep mode Page 62 of 84
C1-Public
SARA-R41 series - Application note
If the host application does not desire to use the fallback option to PSM without network coordination,
then it can use PSM with network coordination configuration mode only. The guidelines to using it in
this configuration are:
• Set the PSM with network coordination mode only (+UPSMVER: 4).
• If the network does not grant the use of PSM, it is still possible to save power with timed periodic
graceful shutdown and power-up. To implement this fallback alternative, the host should:
o Keep track of requested T3324 and T3412 timers to enter and exit PSM, starting them at
+CSCON: 0.
o Check whether PSM has not been granted by the network via the +UCPSMS and +CEREG read
commands.
o To minimize power consumption at the requested T3324 timer expiry gracefully shut down the
module to detach itself from the network, releasing the present PDP context.
☞ From the shutoff state, power up the module again at the requested T3412 timer expiry. On
SARA-R410M-02B-01, SARA-R410M-02B-02, SARA-R410M-02B-03, SARA-R412M-02B-00,
SARA-R412M-02B-01, SARA-R412M-02B-02, SARA-R412M-02B-03, SARA-R4 “01B” / “52B” /
“63B” / “73B” / “83B” product versions, it is not possible to check whether the PSM has not been
granted by the network via the +UCPSMS and +CEREG read commands. If the +UCPSMS and
+CEREG read commands provide the requested T3324 timer, the only way to know that PSM has
not been granted by network is that the module does not enter PSM when the requested T3324
timer expires.
UBX-18019856 - R13 Paging, eDRX, PSM and deep sleep mode Page 63 of 84
C1-Public
SARA-R41 series - Application note
UBX-18019856 - R13 Paging, eDRX, PSM and deep sleep mode Page 64 of 84
C1-Public
SARA-R41 series - Application note
With PSM enabled, if AT+ULWM2M=1 is applied to stop the LwM2M client, then when the module
enters the PSM sleep mode and then later exits the sleep state, the LwM2M client will once again
initialize and resume due to its volatile setting. For more details, see SARA-R4 series AT commands
manual [2]. If desired to disable the LwM2M client again, a subsequent AT+ULWM2M=1 command is
then necessary when the client resumes.
UBX-18019856 - R13 Paging, eDRX, PSM and deep sleep mode Page 65 of 84
C1-Public
SARA-R41 series - Application note
20 GNSS
SARA-R4 series modules support reading NMEA strings from the GNSS receiver through AT
commands. The GNSS device management can be performed through the cellular module as well.
21 Testing
21.1 Digital pin testing (+UTEST=10)
Table 2 provides the list of pins that can be tested by means of the AT+UTEST=10 command. The
command allows the user to perform some verifications on all the digital pins of the SARA-R4 series
modules.
Pin number Name Description
6 DSR UART data set ready
7 RI UART ring indicator
8 DCD UART data carrier detect
9 DSR UART data terminal ready
10 RTS UART ready to send
11 CTS UART clear to send
12 TXD UART data input
13 RXD UART data output
16 GPIO1 GPIO
19 GPIO6 GPIO
23 GPIO2 GPIO
24 GPIO3 GPIO
25 GPIO4 GPIO
26 SDA I2C bus data line
27 SCL I2C bus clock line
34 I2S_WA / SPI_MOSI I2S word alignment /
SPI Master Output Slave Input
35 I2S_TXD / SPI_CS I2S transmit data /
SPI Chip Select
36 I2S_CLK / SPI_CLK I2S clock / SPI clock
37 I2S_RXD / SPI_MISO I2S receive data / SPI Master Input Slave Output
42 GPIO5 SIM detection
44 SDIO_D2 SDIO serial data [2]
45 SDIO_CLK SDIO serial clock
46 SDIO_CMD SDIO command
47 SDIO_D0 SDIO serial data [0]
48 SDIO_D3 SDIO serial data [3]
49 SDIO_D1 SDIO serial data [1]
Below is an example of configuring RTS and CTS as output and set to high. This example can only be
done through the USB interface.
Command Response Description
Configure the formatting of the error result
code by means of +CMEE AT command.
AT+COPS=2 OK Deregister the module from the network.
AT+UTEST=1 OK The module enters the test mode.
AT+UTEST=10,1 (pin description returned) Gets the pin information.
OK
AT+UTEST=10,2,"000000000000000000 OK The command puts the module in Interface
000600" initialized state; the command saves the pins
status to restore it at the end of the test. Pins
enabled for testing: RTS pin 10, CTS pin 11
Where hex: 0000 0000 0000 0000 0000 0600
AT+UTEST=10,3,"000000000000000000 OK RTS and CTS are configured for output where
000000" the bits for the pins 10,11 are set low
Where hex: 0000 0000 0000 0000 0000 0000
AT+UTEST=10,4,"000000000000000000 OK RTS and CTS is set to high for pin 10, 11
000600" Where hex: 0000 0000 0000 0000 0000 8000
AT+UTEST=10,5 Configurations made by AT+UTEST=10,2;
AT+UTEST=10,3 and AT+UTEST=10,4 are
executed.
AT+UTEST=10,6 000000000000000000000600 Logic digital value measured at modules pins
OK for GPIO1, and "high" level detected.
• When a SARA-R4 series module is programmed to enter the end user test mode, the +CFUN: 5
URC will be reported if the module is in +UTEST mode, and it can be used as an indication the
module does not exit properly the +UTEST mode.
• The usage of this command shall be restricted to controlled (shielded chamber/box) environments
and for test purpose only, especially when RF testing.
☞ If the +UGPIOC, +UGPIOR, and +UGPIOW AT commands are used in the same power-up session,
then apply these commands before applying the AT+UTEST=10 command. This will allow
AT+UTEST=10 to interact with the pins effectively, and not have conflicting control with the other
commands.
☞ The +UMACQOSTMR AT command is supported by SARA-R4 “02” product versions except for
SARA-R410M-02B-00, SARA-R410M-02B-01, SARA-R410M-02B-02, SARA-R412M-02B-00, and
SARA-R412M-02B-01.
On products / firmware that feature the +UMACQOSTMR AT command timer, this timer may need to
be disabled to allow certain measurements. RF sensitivity measurements, for example, expect the
local RRC connection to remain in the connected state. If this MAC QoS timer is not disabled, then
after the timer expires, it will release the RRC connection with the simulator and may interrupt the
measurement.
Here is an example of checking for the MAC QoS timer value and setting it
Command Response Description
AT+UMACQOSTMR? +UMACQOSTMR: 35,-1 Check if MAC QoS timer is enabled by reading it. In this
OK example, it is enabled for LTE Cat. M1 with 35 s timer. It is
disabled for NB-IoT.
AT+UMACQOSTMR=0 OK Disabled MAC QoS timer for LTE Cat. M1 with 0 value set.
AT+CFUN=15 OK Reset the device for new value to disable MAC QoS timer.
AT+UMACQOSTMR? +UMACQOSTMR: -1,-1 Confirm MAC QoS timer is disabled, which in this
OK example it is reflected as disabled with “-1” value for both
LTE Cat. M1 and NB-IoT.
Another factor to consider with using a test simulator is the need for using a dedicated test SIM. For
more details, see section 25.1.
22 Debugging
22.1 Logging port
SARA-R4 series modules assign the USB interface for logging capabilities.
☞ For full debugging of the module, customers must use a dedicated logging application. Customers
need to request for this debug application, which is licensed. This debug tool is not free to use.
☞ The standard u-blox m-center tool is able to capture a modem log that is limited to certain
message traces. A limitation of the log output is that it lacks over-the-air traces, which are needed
to debug connectivity to the cellular network. A custom m-center version is capable of capturing
the over-the –air traces. m-center includes instructions on how to capture a log through its built-in
help menu. If needed, contact u-blox support for guidance about taking an m-center trace or for
more details on the custom m-center.
• The USB interface for logging will also work in parallel to the AT commands port.
• It is strongly recommended to add USB test points for later debugging.
For application using the UART interface to issue AT commands, the module must boot up without
the USB interface connected to a host device. This allows the UART interface to establish AT
connectivity with the host MCU. After the UART communication is established the USB interface can
be connected for logging.
If the full attachment / registration procedure is desired in the logs or any commands that quickly
follow registration, then the host app shall set the device to minimal functionary with AT+CFUN=0, and
then issue AT+CFUN=1 when ready to log.
Before capturing any logs, ensure the device has the logging bitmask correctly set to enable full
logging output with +ULOG AT command.
23 Migration
23.1 SARA-G3
23.1.1 PDP activation
The PDP context activation is the same on SARA-R412M in 2G network (+URAT: 9).
23.1.2 +UPSDA
SARA-R4 series modules will automatically activate sockets on <cid> =1 (PDP context id).
24 SMS
24.1 SMS preferred message storage
The factory-programmed value for SARA-R4 series is "ME" for the three memory parameters
<mem1>, <mem2>, and <mem3>. The setting can be set or read by +CPMS. However, on SARA-R4
modules, the memory storage must be all the same type and cannot be mixed.
This is an example of setting the +CPMS storage parameter for all memory parameters to the same
value.
Command Response Description
AT+CPMS="ME","ME","ME" +CPMS: 0,23,0,23,0,23 Set all three memory storage parameters
OK to “ME” memory storage.
AT+CPMS? +CPMS: "ME",0,23,"ME",0,23,"ME",0,23 Read the storage setting back.
OK
For more details on the +CPMS AT command, see SARA-R4 series AT commands manual [2].
25 SIM
25.1 Chip SIM
For devices utilizing a physically soldered down chip SIM, consider what network or networks the
device will connect to. More specifically, beyond the obvious intended end network(s) the device will
deploy on, keep in mind the need to connect with a test network or base station simulator call-boxes,
which may require a specific UICC profile to connect to. Anticipate such needs and be prepared to be
able to obtain and configure a profile to connect to such networks or simulators. Alternatively,
configure a device(s) with a SIM card holder for physical removable SIM for such engineering or pre-
production activities.
26 WWAN adapter
☞ The Qualcomm WWAN adapter is not supported by u-blox.
Figure 3: Windows Device Manager: Qualcomm WWAN port that needs to be disabled
☞ It is critical that the host application follows the proper safe & graceful shutdown procedure
outline in the SARA-R4 series system integration manual [3]. Backup & Restore feature is
intended only as an addition backup mechanism, if on the potential rare occasion, the host
application shutdown is not conforming to the graceful power down guidelines.
27.1 Description
There are two parts to the EFS (Electronic File System) backup & restore feature for SARA R410M
and SARA-R412M module product types with FW versions that support this feature.
The backup feature is optional for a device that comes with this feature from the factory, where the
host can perform a backup of the file system to supersede the previous or original backup done during
the module production. This will allow the latest user values in the file system to be captured in the
backup copy. This includes NV settings, current MNO profile, user files and certificates.
There is a special case where the backup counter goes to zero from a non-zero value. For more details,
see section 27.1.1.
The restore feature allows the modules to automatically recover from a fatal file system corruption,
where the module cannot fully boot up. The module uses this function when it detects such a
corruption from a previous improper shutdown at the next module boot-up. For deployed field devices,
if the corruption is non-fatal and the module can boot up, the host can manually trigger a restore.
There are three known types of non-fatal corruption:
• Loss of IMEI
• MNO profiles lost or duplicated
• Device goes into the non-signaling mode (for more details, see the +UTEST=10 AT command in
the SARA-R4 series AT commands manual [2])
☞ It is recommended to enable greeting text messages via the +CGST AT command after first
power-up at the host application factory. It is also recommended to trigger a manual backup after
the device has been fully configured at production. This way if the restore event should occur in
the field, the greeting text will help to indicate that the AT interface is available and the module is
ready to run with the production configuration.
Additionally, there is a special case when host can issue a backup: backup counter for number of
backups goes to zero from a non-zero value. This counter can be read and monitored with the
+UBKUPDATA AT command.
☞ Modules with factory-programmed configuration come with a backup copy and therefore the
backup counter would be 1, which should be verified in host device production. If this counter
should later go to 0, the host should trigger a backup and then after completed, verify the counter
has a value of 1.
The command's query response contains the number of backups and restores for each file system.
☞ There are not multiple backup “versions” stored; only a single copy of the latest backup is kept.
☞ To avoid excessive flash wear, the backup should be performed on a limited basis such as after
host application production and initialization.
☞ It can take up to 15 s for a backup to execute. This time includes the boot-up time.
To detect when the backup function is complete, and the AT interface is available here are following
options:
• Wait for +UUBKUPDATA URC
o Example for backup successful: +UUBKUPDATA: 1,1
• Loop AT until the OK final result code is issued
o Example: send AT every one second until the OK final result code is got
• Enable and monitor GPIO for “Module status indication” via +UGPIOC AT command
• Enable and monitor greeting message +CSGT
If the restore process is interrupted (e.g., through power pull), the process will start from the
beginning again at next boot-up.
There is no available indication to the host processor that a restore is taking place during boot up; it
would just appear as if boot-up is taking longer than typical. If a restore should take place, then the
host processor would need to allow more time for the device to handle the restore, until the AT
interface is made available.
☞ It can take up to 15 s for a restore to execute. This time includes the boot-up time.
The host can detect when a restore has taken place by URC notification.
Example: the +UUBKUPDATA: 2,1 URC indicates restore has taken place and is successful.
A manual restore can be triggered when one of the following conditions is detected by the host in the
field:
• Loss of IMEI, which can be checked and detected with the +CGSN or ATI command, where:
o The +CSGN AT command would return the "+CME ERROR: memory failure" error result code
o The ATI command for Identification Information would return a blank IMEI in the response
• MNO profiles lost or duplicated, which can be checked and detected by the +UMNOPROF AT
command
• The device goes into the non-signaling mode and is unable to exit with AT+UTEST=0 and the
+CFUN AT command cannot change its state from a value of 5. This non-signaling state can be
checked and detected with the +CFUN read command, where the device would return a value of 5.
Restore is only intended for the above situations, and the host should verify that the restore operation
corrects the issue if executed.
Example on using the +CGSN and ATI command to detect lost IMEI
Command Response Description
AT+CGSN +CME ERROR: memory failure Error response indicates lost IMEI using
+CGSN command. The error response
format differs between each +CMEE
setting. The example shown here is for
+CMEE: 2.
ATI Manufacturer: u-blox Blank IMEI indicates lost IMEI using ATI
Model: SARA-R410M-02B command
Revision: L0.[Link].12 [Jan 01
2021 12:00:00]
IMEI:
OK
With the possibility of a restore event, to detect when the module boot-up is complete and AT
interface is available here are following options:
• Loop AT until the OK final result code is issued
o Example: send AT every one second until the OK final result code is received
• Enable and monitor GPIO for “Module status indication” functionality via the +UGPIOC AT
command
• Enable and monitor the greeting message via the +CGST AT command
• Both the module status indication and greeting message option would require to be enabled and
then saved into the EFS backup copy. If a restore should ever be triggered, then the EFS backup
copy would be restored with the feature enabled.
Figure 4 Flashing module is completed. Module will boot-up after success and perform first Backup.
After the first backup is performed automatically post flashing with EasyFlash, confirm the backup
copy.
Command Response Description
AT+UBKUPDATA? +UBKUPDATA: 0,0,1,0,0,0,"" Backup copy confirmed as indicated by
OK the “1” for one backup performed.
Appendix
A LTE Cat M1 vs NB1
SARA-R4 series modules can communicate using the 3GPP LTE Cat M1 and NB1 technologies. They
both have features based on the 3GPP Release 13 specification.
Rel. 13 Cat M1 Rel. 13 NB-IoT
Deployment In-band LTE In-band, guard band LTE, and standalone
Coverage 155.7 dB 164 dB
Downlink OFDMA, 15 kHz tone spacing, Turbo code, 16 QAM, OFDMA, 15 kHz tone spacing, TBCC, 1 Rx
1 Rx
Uplink SC-FDMA 15 kHz tone spacing, Turbo code, 16QAM Single tone, 15 kHz and 3.75 kHz spacing
SC-FDMA, 15 kHz tone spacing
Turbo code
Bandwidth 1.08 MHz (6 resource blocks) 180 kHz (1 resource block)
Duplexing FD, HD (Type-B), FDD/TDD HD only (Type-B), FDD-only (TDD for future releases)
Peak rate (UL/DL) 1 Mb/s DL and UL DL – ~32 kb/s (in-band), 34 kb/s (standalone)
UL – ~66 kb/s multitone, ~17 kb/s single tone
Power saving PSM, eDRX, DRX PSM, eDRX, DRX
Power class Class 3 (23 dBm) Class 3 (23 dBm)
Core network Same as LTE Simplified core network(optional), small data
enhancements (data over NAS or user plane with
security context in RAN) (additional non-IP data
support)
B Glossary
Abbreviation Definition
3GPP 3rd Generation Partnership Project
APN Access Point Name
AT AT Command Interpreter Software Subsystem, or attention
BIP Bearer Independent Protocol
CHAP Challenge Handshake Authentication Protocol
DCE Data Communication Equipment
DL Downlink
DLCI Data Link Connection Identifier
DRX Discontinuous Reception
DTE Data Terminal Equipment
DUN Dial-up Networking
eDRX extended Discontinuous Reception
EMM EPS Mobility Management
EPS Evolved Packet System
FDD Frequency Division Duplex
FOTA Firmware Over The Air
FTP File Transfer Protocol
GNSS Global Navigation Satellite System
GPIO General Purpose Input Output
GPRS General Packet Radio Service
GPS Global Positioning System
GSMA GSM Association
HTTP HyperText Transfer Protocol
ICCID Integrated Circuit Card ID
IIN Issuer Identifier Number
IMEI International Mobile Equipment Identity
IP Internet Protocol
L1 Layer 1
LCP Link Control Protocol
LPWAN Low-Power Wide-Area Network
LTE Long Term Evolution
M2M Machine to Machine
MCU Multipoint Communication Unit
MDN Message Disposition Notification
ME Mobile Equipment
MNO Mobile Network Operator
MQTT Message Queueing Telemetry Transport
MSC Modem Status Command
MT Mobile Terminated
MVNO Mobile Virtual Network Operator
NAS None Access Stratum
NB-IoT Narrow Band IoT
NMEA National Marine Electronics Association
Abbreviation Definition
NVM Non Volatile Memory
NW Network
OFDMA Orthogonal Frequency-Division Multiple Access
PAP Personal Authentication Protocol
PDP Parallel Data Protocol
PLMN Public Land Mobile Network
PPP Point-to-Point Protocol
PS Protocol Stack
PSM Power Save Mode
RAN Radio Access Network
RAT Radio Access Technology
RF Radio Frequency
RRC Radio Resource Control
RRM Radio Resource Management
RTC Real Time Clock
RX Reception
SC-FDMA Single-carrier FDMA
SIM Subscriber Identification Module
TAU Tracking Area Update
TCP Transmission Control Protocol
TDD Time Division Duplex
TX Transmission
UART Universal Asynchronous Receiver-Transmitter
UDP User Datagram Protocol
uFOTA u-blox FOTA
UL Uplink
URC Unsolicited Result Code
USB Universal Serial Bus
Table 3: Explanation of the abbreviations and terms used
Related documentation
[1] u-blox SARA-R4 series data sheet, UBX-16024152
[2] u-blox SARA-R4 series AT commands manual, UBX-17003787
[3] u-blox SARA-R4 series system integration manual, UBX-16029218
[4] u-blox SARA-R4 series Firmware update application note, UBX-17049154
[5] u-blox SARA-R5 / SARA-R4 series GNSS implementation application note, UBX-20012413
[6] u-blox Mux implementation in cellular modules application note, UBX-13001887
[7] u-blox LwM2M objects and commands, UBX-18068860
[8] u-blox EVK-R4 user guide, UBX-16029216
[9] u-blox LTE attachment & transport planes presentation, UBX-19006672
[10] u-blox IoT Security-as-a-Service overview,
[Link]
[11] 3GPP TS 36.321 - Evolved Universal Terrestrial Radio Access (E-UTRA); Medium Access
Control (MAC) protocol specification
[12] 3GPP TS 36.101 – LTE; Evolved Universal Terrestrial Radio Access (E-UTRA); User Equipment
(UE) radio transmission and reception
[13] 3GPP TS 24.008 - Annex G (informative): 3GPP specific cause values for mobility management
[14] 3GPP TS 24.301 - Non-Access-Stratum (NAS) protocol for Evolved Packet System (EPS);
Stage 3
[15] 3GPP TS 27.010 - Terminal Equipment to Mobile Station (TE-MS) multiplexer protocol
[16] RFC 6347 - Datagram transport layer security (DTLS)
[17] RFC 793 - Transmission control protocol (TCP) protocol specification
☞ For regular updates to u-blox documentation and to receive product change notifications, register
on our homepage ([Link]).
Revision history
Revision Date Name Status / Comments
R01 25-Oct-2018 pwar / clee Initial release
R02 07-Dec-2018 pwar / clee Review release
R03 04-Feb-2019 pwar / clee General release
R04 08-Feb-2019 pafe Extended document applicability to SARA-N4 series
R05 19-Jun-2019 pwar Minor updates
R06 30-Sep-2019 skri / clee Added SMS
R07 27-Jan-2020 clee Extended document applicability to SARA-R410M "63" / "73" product versions
R08 12-Jun-2020 clee Extended document applicability to SARA-R410M-83B product version
Added disabling WWAN adapter
R09 03-Sep-2020 clee Minor updates
R10 10-Dec-2020 clee Minor updates
R11 03-Mar-2021 clee Added EFS backup & restore
R12 17-Sep-2021 clee Minor updates
R13 08-Jul-2022 clee Added guidance of 1. configuration for T-Mobile US network, 2. multi IMSI MVNO
SIMs, 3. performing a restore if Backup/Restore counters go to zero.
Updated section: PSM Modes
Contact
For further support and contact information, visit us at [Link]/support.