background image

 

SARA-R42 - Application note 

UBX-20050829 - R02 

AT commands response parser

 

Page 12 of 58 

C1-Public 

 

 

4

 

AT commands response parser 

It is important that the user implements a dedicated AT parser component in the host application. 

Basic guidelines: 

 

When entering AT commands, spaces are ignored. 

 

The DTE shall handle the case of unexpected spaces or line endings, i.e. the <CR><LF> characters. 

 

As suggested in the SARA-R4 series AT commands manual 

[2]

always wait for at least 20 ms 

following a final result code or a URC reception before issuing a new AT command. 

 

When the module has finished processing an AT command, it will output a final result code (either 
OK  or  ERROR)  indicating  that  it  is  ready  to  accept  a  new  AT  command.  The  information  text 
responses are issued before the final result code. CMEE setting to numeric or verbose 
value (for example, 

AT+CMEE=1

 or 

AT+CMEE=2

).  

 

Asynchronous commands (for example, 

+UMQTTC

) return an immediate final result code and final 

result via URC. 

 

Some AT commands return an intermediate result code (IRC) during command execution. 

 

Due to interface restrictions, when using multiple AT command interfaces, the parser should take 
into account that in SARA-R42 series it is not possible to have parallel activity on two or more AT 
terminals. Basically this behavior can be detected in the following configurations: 

o

 

double UART availability, i.e. 

+USIO:1

o

 

virtual channels set through multiplexer (MUX). 

The only allowed parallel activity is present when it is defined a system architecture with a PPP 
dial-up on one port and AT commands on the other one. 

4.1

 

Operational modes of the AT interface  

When implementing the AT parser, it is important to consider that the communication port, whether 
the  main  UART  or  a  MUX  virtual  port,  enters  different  operational  modes  while  processing  AT 
commands. 

In  command  mode,  the  module  (called  DCE 

  data  communication  equipment)  can  receive  AT 

commands. Once an AT command is detected on the AT interface, the DCE processes it and  may 
return to command mode by issuing a success or error response. Special AT commands lead the AT 
interface into intermediate states where, for example, an SMS payload is expected, or raw/binary data 
is exchanged (for example, during file transfer), or PPP packets are exchanged. In the latter case, the 
PPP data mode can be temporarily exited by a special 

+++

 packet or DTR line ON-to-OFF transition 

and  the  online  command  mode  (OLCM)  state  is  entered:  from  this  state,  which  is  similar  to  the 
command mode, the DCE can be moved back to PPP data mode via 

ATO

 command or can disconnect 

PPP via 

ATH

 command (having previously applied 

AT+CVHU=0

 as mandatory setting). 

Figure 2 

depicts the various modes in which the module can operate and shows the actions that cause 

transitions  between  the  different  modes.  The  transitions  triggered  by  DTR  line  changes  are 
configurable with the 

AT&D

 command, see SARA-R4 series AT commands manua

[2]

. 

For more details about the AT command interface settings, see the AT command settings section in 
the SARA-R4 series AT commands manual 

[2]

. 

Содержание SARA-R42

Страница 1: ...blox com SARA R42 Application development guide Application note Abstract This document provides detailed technology architecture and examples of how to use AT commands with u blox SARA R422 SARA R42...

Страница 2: ...n 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 expres...

Страница 3: ...Core application 11 3 2 6 Power off 11 3 3 Application modes 11 3 3 1 Debug test mode 11 3 3 2 Production testing 11 3 3 3 Certification mode 11 3 3 4 Firmware update mode 11 4 AT commands response pa...

Страница 4: ...6 8 1 2 Timer values 27 8 1 3 PSM and roaming 28 8 1 4 Example of usage of PSM 28 8 2 Deep sleep mode 29 8 2 1 Deep sleep aware applications and deep sleep postponing 29 8 2 2 Deep sleep indications 3...

Страница 5: ...ng backup after flashing FW update with delta package 49 13 1 4 EasyFlash backup and SMS storage 49 14 Restore factory configuration 50 15 Specialized application notes by topic 52 15 1 Multiplexer 52...

Страница 6: ...SARA R412M to SARA R42 modules Table 1 shows a summary of the documentation available for SARA R42 Document name Notes Application integration Application development guide app note This document Sta...

Страница 7: ...ing it well suited for critical applications running on devices that may be deployed in the field for extended periods of time As M stands for mobility the LTE Cat M1 standard specifies Connected Mode...

Страница 8: ...elected see the SARA R4 series system integration manual 3 and the SARA R4 series AT commands manual 2 To benefit from the enhancement of the LPWA standards the power saving mode PSM can be enabled to...

Страница 9: ...fication mode Maintenance FW update mode Debug test mode Production mode Power cons optimization Normal mode Figure 1 Application design 3 1 Initial design decisions If some features will never be use...

Страница 10: ...ctive LTE bands The host application should implement a persistent configuration setting phase performed once and then at an as needed basis where all AT commands related to the required settings are...

Страница 11: ...eded it may be necessary to configure different verbosity levels for the host application and modules log This can be done with configuration files that can be side loaded to the file system In extrem...

Страница 12: ...UX The only allowed parallel activity is present when it is defined a system architecture with a PPP dial up on one port and AT commands on the other one 4 1 Operational modes of the AT interface When...

Страница 13: ...report a specific event or status change on the same AT port If the AT port is busy the application can decide to discard CIND CGEV and SMS related URC by properly configuring the related AT commands...

Страница 14: ...and AT commands on the other port The URINGCFG AT command is not applicable when the AT USIO 1 option is selected due to the fact that the RING line is not available at UART level in this configuratio...

Страница 15: ...heck the current baud rate Table 5 Setting a fixed baud rate example The UART speed takes around 200 ms to reconfigure itself after a baud rate change through the IPR AT command To show a greeting tex...

Страница 16: ...full V24 modem lines are not supported In this configuration entering in OLCM or disconnecting the PPP connection via DTR line de assertion is not possible Issue the AT CVHU 0 command to make ATH ove...

Страница 17: ...The host application should specify an MNO profile The default and factory programmed MNO profile is 90 global profile Reboot the module by means of AT CFUN 15 command or the equivalent AT CFUN 16 to...

Страница 18: ...wever there may be changes that need to be applied to the module for proper operation with any given MNO such as attach type RAT preference band selection etc Please consult with the preferred network...

Страница 19: ...OK Set the automatic MNO profile detection the automatic reset and enable the related URC AT CFUN 15 DTE is required to perform first reboot AT UMNOPROF UMNOPROF 1 0 OK UMNOPROF is ready to perform au...

Страница 20: ...0 0 0 0 0 0 0 0 0 0 0 0 219 524288 Enable B2 B4 B5 B12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 211 24 23 21 2074 Enable B4 B13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0...

Страница 21: ...e can be selected by the host application based on the tradeoff between power consumption and maximum tolerable delay before regaining cellular coverage 7 2 First time registration setup It is importa...

Страница 22: ...Protocol Configuration Options ePCO container is used in Network Access Stratum NAS messaging when attaching to an LTE network Some NB IoT mobile operators do not support ePCO container therefore if...

Страница 23: ...kom DT MNO the limit is 30 the maximum number of PDP context activations requests per hour following a PDP context activation request ignored by the network e g for DT it is 60 rejected with a permane...

Страница 24: ...d has a AcT parameter which describes the access technology the module is registered to However this command does not provide a URC when the module is registered There are other AT commands that do ha...

Страница 25: ...using the abort of the RRC connection and the interruption of the data traffic A possible solution to this situation is to apply a manual PLMN selection as a workaround for this specific SIM setting F...

Страница 26: ...etwork then the module can not use PSM In this case for example the host application could power on and off the module with the desired periodicity in order to save power Two timers determine the entr...

Страница 27: ...as GPRS timer 3 IE see TS 3GPP TS 24 008 12 Bits 5 to 1 represent the binary coded timer value Bits 6 to 8 define the timer value unit for the GPRS timer and are encoded as follows BIT 8 7 6 0 0 0 val...

Страница 28: ...PSMVER UPSMVER 4 3 3 4 0 OK Make sure the UPSMVER AT command is set to its default value where PSM with context retention feature is enabled otherwise enable it and start from the beginning AT CPSMS C...

Страница 29: ...for MO data waking up the module just before it exits PSM deep sleep by itself when possible To keep power consumptions in deep sleep extremely low the only running module component in this state is a...

Страница 30: ...g if RXD is low for more than 1 character UUPSMR URC printed on the AT interface when entering and exiting deep sleep mode 8 2 3 Deep sleep state in out of service The power efficient deep sleep mode...

Страница 31: ...reliability it is also advisable to request at least two TeDRX cycles during the T3324 active time see Figure 4 Power Save Mode Paging window 2 56s cycle eDRX cycle N Hyper frames of 10 24 s T3324 pe...

Страница 32: ...after having configured eDRX deep sleep with AT UPSMVER 8 command which forces eDRX to be used standalone disabling PSM requests to the network When the eDRX deep sleep feature is used power consumpti...

Страница 33: ...t transmission or reception is complete the RRC connection is released by the network The device enters the idle state and starts T3324 and T3412 timers 5 While the T3324 timer is running paging is li...

Страница 34: ...URCs provide the most updated information and in some cases diagnostic information which is not available via polling For AT commands that enable URCs they might also return the same information when...

Страница 35: ...level No AT CNMI 2 1 CMTI mem index Report the index in current selected memory can be the factory programmed setting ME or SIM see CPSM read command where the mobile terminated SMS has been stored Th...

Страница 36: ...del and FW identification useful for tracking purposes Module initialization AT CGSN 355438110017558 Return the IMEI Module initialization AT CIMI AT CCID 001010123456789 CCID 89860000502000180722 Ret...

Страница 37: ...IM refresh only in debug test mode AT CEDRXRDP CEDRXRDP AcT_type Requested_eDRX_cycl e Assigned_eDRX_cycle_value Assigned_pa ging_time_window It returns the current eDRX parameters assigned by the mob...

Страница 38: ...address cannot establish dial up Detach re attach AT CFUN 0 AT CFUN 1 Consider possible restrictions to multiple cid s active for APN If IPv6 only PDN is set in Verizon Wireless MNO setting detach de...

Страница 39: ...ossible it is suggested to use test SIM cards during production tests possibly the same SIM card used during the device validation If a test SIM card is not available and if the production tests are p...

Страница 40: ...in a specified channel to return the measured power level in all supported bands The minimum recommended RF verification in production consists in forcing the module to transmit in a supported frequen...

Страница 41: ...e is not completely in non signaling mode because CFUN reports that it is in test mode Below is the sequence to correct this AT CFUN 0 OK Set the MT to minimum functionality AT CFUN 1 OK Sets the MT t...

Страница 42: ...for RF TX non signaling mode Command Response Description AT UTEST 3 123060 23 0 OK Turn on the continuous TX in B12 Ch 123060 23 dBm AT UTEST 3 123060 23 1000 UTEST 123060 23 5 1 1000 OK Turn on TX...

Страница 43: ...tate the command saves the pins status to restore it at the end of the test Pins enabled for testing GPIO1 pin 16 Where hex 0000 0000 0000 0000 0000 8000 AT UTEST 10 3 000000000000 000000000000 OK GPI...

Страница 44: ...th the pins effectively and not have conflicting control with the other commands 10 2 Network simulators testing When testing with network simulators such as a CMW500 from Rohde Schwarz as one example...

Страница 45: ...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...

Страница 46: ...re accepted the CREG read command and URC would report that it is not registered for CS services Since it can happen that SMS services are not supported in NB IoT in AT URAT 8 there is no means to und...

Страница 47: ...es system integration manual 3 Backup Restore feature is intended only as an additional backup mechanism if on the potential rare occasion the host application shutdown is not conforming to the gracef...

Страница 48: ...AT interface is available here is the following option Wait for UUBKUPDATA URC o Example for backup successful UUBKUPDATA 1 1 13 1 2 EFS restore When an automatic restore is triggered the device will...

Страница 49: ...is received Enable and monitor the GPIO pin with Module status indication functionality via the UGPIOC AT command Enable and monitor the greeting message via the CGST AT command 13 1 3 Creating backu...

Страница 50: ...stored 2 Reboot the module The UFACTORY AT command writes a flag in NVM and does not perform any restoring action This flag is then read at the next reboot when the UFACTORY corresponding action is ex...

Страница 51: ...et a UFACTORY action AT UFACTORY UFACTORY 1 0 OK Check the action currently set At the moment a delete user files procedure is requested and will be applied at next reboot AT UFACTORY 0 0 OK Cancel an...

Страница 52: ...ations development guide application note 5 15 3 Security suite See the Security suite application note 6 15 4 Secure communication See the Internet applications development guide application note 5 1...

Страница 53: ...ne termination sequence n r in the CSGT URC and some AT commands in test mode like AT UPSV AT UFOTA plus some others related to the LWM2M functionality AT commands handler applies the uncorrected line...

Страница 54: ...s configuration mode 0 automatic in set functionality does reset the selected RATs configuration mode 0 automatic in set functionality does reset the selected RATs configuration mode 0 automatic in se...

Страница 55: ...ween the provided values FOTASTAT event param1 param2 Applied syntax spaces between the provided values UFOTASTAT event param1 param2 UPSMR URC Applied syntax no spaces between the provided values UPS...

Страница 56: ...HW Hardware LPWAN Low Power Wide Area Network LwM2M Lightweight M2M MNO Mobile Network Operator MO Mobile Originated MT Mobile Terminated NVM Non Volatile Memory NW Network OPLMN Operator Public Land...

Страница 57: ...te UBX 20012413 8 u blox Mux implementation in cellular modules application note UBX 13001887 9 u blox LwM2M objects and commands application note UBX 18068860 10 u blox SARA R5 SARA R422 AWS IoT Core...

Страница 58: ...egional Office China Beijing Phone 86 10 68 133 545 Email info_cn u blox com Support support_cn u blox com Regional Office China Chongqing Phone 86 23 6815 1588 Email info_cn u blox com Support suppor...

Отзывы: