Generic AT commands
This page describes generic AT commands.
UART baud rate AT+IPR
The AT+IPR command sets the UART baud rate.
Set command
The set command sets the UART baud rate. nRF91M1 module does not support automatic baud rate detection. When the device resets, the baud rate is set to the default value set in the devicetree.
Syntax
AT+IPR=<baud_rate>
The parameters and their defined values are the following:
- <baud_rate>
Integer. The desired baud rate.
Note
The baud rate change takes effect after the modem responds with OK.
The host must switch to the new baud rate to continue communication.
Example
Set the baud rate to 115200.
AT+IPR=115200
OK
Read command
The read command reads the current UART baud rate.
Syntax
AT+IPR?
Response syntax
+IPR: <baud_rate>
Example
AT+IPR?
+IPR: 115200
OK
Test command
The test command lists the supported baud rates.
Syntax
AT+IPR=?
Response syntax
+IPR: (list of supported autodetectable baud rates)[,(list of fixed-only baud rates)]
Example
AT+IPR=?
+IPR: (),(115200,230400,460800,921600,1000000)
OK
Echo E0/E1
The E command enables or disables the AT command echo feature of the nRF91M1 module.
Set command
The set command enables or disables the AT command echo feature. While enabled, the nRF91M1 module echoes back all the characters that are received in the AT command mode.
Note
When working with a terminal, you should disable local echo to avoid double echoing of characters.
Syntax
ATE1 - Enable AT command echo.
ATE0 - Disable AT command echo (default).
Example
Set the AT command echo:
ATE1
OK
AT
AT // Echoed command
OK
ATE0
ATE0 // Echoed command
OK
AT
OK
Read command
The read command is not supported.
Test command
The test command is not supported.
Serial Modem version #XSMVER
The #XSMVER command returns the versions of the Serial Modem application firmware and nRF Connect SDK in which the application firmware is built.
Set command
The set command returns the versions of the Serial Modem application firmware and nRF Connect SDK.
Syntax
AT#XSMVER
Response syntax
#XSMVER: "<sm_version>","<ncs_version>"[,"<customer_version>"]
The parameters and their defined values are the following:
- <sm_version>
String.
The version of the Serial Modem application firmware in
v<major>.<minor>.<patch>format.Hosts can use the version to verify that application DFU or FOTA moved to a newer image. To check, compare the
AT#XSMVERresponse before and after the update.- <ncs_version>
String. The version of the nRF Connect SDK in
<major>.<minor>.<patch>format.
- <customer_version>
String. This parameter is missing on official release builds. It is used in special cases such as FOTA-TEST builds.
Example
The following command examples read the versions:
// v2.0.0 release
AT#XSMVER
#XSMVER: "v2.0.0","3.4.1"
OK
// FOTA test package for v2.0.0 release
AT#XSMVER
#XSMVER: "v2.0.0","3.4.1","FOTA-TEST"
OK
Read command
The read command is not supported.
Test command
The test command is not supported.
SM proprietary command list #XCLAC
The #XCLAC command requests the list of the proprietary nRF91M1 module commands.
Set command
The set command requests the list of the proprietary nRF91M1 module commands.
It is an add-on for AT+CLAC, which lists all modem AT commands.
Syntax
AT#XCLAC
Response syntax
<command list>
The parameters and their defined values are the following:
- <command list>
String. A list of values representing all the
#X*commands followed by <CR><LF>.
Example
AT#XCLAC
AT#XSMVER
AT#XSLEEP
AT#XCLAC
AT#XSOCKET
AT#XBIND
AT#XCONNECT
AT#XSEND
AT#XRECV
AT#XSENDTO
AT#XRECVFROM
AT#XPING
AT#XGNSS
OK
Read command
The read command is not supported.
Test command
The test command is not supported.
Power saving #XSLEEP
The #XSLEEP command makes the nRF91M1 module to enter idle or sleep mode.
Note
The #XSLEEP command is intended for experimentation and power consumption measurements and must not be used in production.
You can use the DTR (Data Terminal Ready) and RI (Ring Indicator) signals to control the power state of the UART between the nRF91M1 module and the host. See the UART configuration section for more information about DTR and RI.
Note
If you want to do power measurements on the nRF91 Series development kit while running the nRF91M1 module, remember to disable unused peripherals.
Set command
The set command makes the nRF91M1 module enter either Idle or Sleep mode.
Syntax
AT#XSLEEP=<sleep_mode>
The parameters and their defined values are the following:
- <sleep_mode>
1- Enter Sleep. In this mode, both the nRF91M1 module service and the LTE connection are terminated.nRF91M1 module can be woken up using the DTR pin.
2- Enter Idle. In this mode, both the nRF91M1 module service and the LTE connection are maintained, but the UART is disabled to save power. Received data is buffered and sent to the host after idle mode is exited.nRF91M1 module can exit the idle mode using the DTR pin. When the nRF91M1 module is in idle mode, and there is data to be read by the host, the RI pin is asserted for a short period of time to notify the host. The host can then deassert and assert DTR to exit idle mode and read the data.
Note
If the modem is on, entering Sleep mode (by issuing
AT#XSLEEP=1) sends a+CFUN=0command to the modem, which causes a write to non-volatile memory (NVM). Take the NVM wear into account, or put the modem in flight mode by issuingAT+CFUN=4before Sleep mode.
Examples
AT#XSLEEP=0
ERROR
AT#XSLEEP=1
OK
See the following for an example of when the modem is on:
AT+CFUN=4
OK
AT#XSLEEP=1
OK
AT#XSLEEP=2
OK
Read command
The read command is not supported.
Test command
The test command tests the existence of the AT command and provides information about the type of its subparameters.
Syntax
AT#XSLEEP=?
Response syntax
#XSLEEP: <list of shutdown_mode>
Example
AT#XSLEEP=?
#XSLEEP: (1,2)
OK
Power off #XSHUTDOWN
The #XSHUTDOWN command makes the nRF91 Series SiP enter System OFF mode, which is the deepest power saving mode.
Set command
The set command makes the nRF91 Series SiP enter System OFF mode.
Syntax
AT#XSHUTDOWN
Note
In this case the nRF91 Series SiP cannot be woken up using the DTR pin.
Example
AT#XSHUTDOWN
OK
Read command
The read command is not supported.
Test command
The test command is not supported.
Reset #XRESET
The #XRESET command performs a soft reset of the nRF91 Series SiP.
Set command
The set command resets the nRF91 Series SiP.
Syntax
AT#XRESET
Example
AT#XRESET
OK
Ready
Read command
The read command is not supported.
Test command
The test command is not supported.
Modem reset #XMODEMRESET
The #XMODEMRESET command performs a reset of the modem.
The modem is set to minimal function mode (via +CFUN=0) before being reset.
The nRF91M1 module is not restarted.
After the command returns, the modem will be in minimal function mode.
Set command
The set command resets the modem.
Syntax
AT#XMODEMRESET
Response syntax
#XMODEMRESET: <result>[,<error_code>]
The parameters and their defined values are the following:
- <result>
0- Success.Positive value - On failure, indicates the step that failed.
- <error_code>
Integer. Only printed when the modem reset was not successful. It is the error code indicating the reason for the failure.
Example
AT#XMODEMRESET
#XMODEMRESET: 0
OK
Read command
The read command is not supported.
Test command
The test command is not supported.
Device UUID #XUUID
The #XUUID command requests the device UUID.
Set command
The set command returns the device UUID.
Syntax
AT#XUUID
Response syntax
#XUUID: <device-uuid>
The parameters and their defined values are the following:
- <device-uuid>
String. The UUID of the device.
Example
AT#XUUID
#XUUID: 50503041-3633-4261-803d-1e2b8f70111a
OK
Read command
The read command is not supported.
Test command
The test command is not supported.
MCUboot bootloader info #XBOOTINFO
Query information about the MCUboot second-stage bootloader.
This command is only available when the firmware is built with the NSIB (B0) and MCUboot as a second-stage bootloader.
Set command
AT#XBOOTINFO=<op>
The parameters and their defined values are the following:
- <op>
0- Query the firmware version of the active MCUboot slot.1- Query which MCUboot slot is currently active.
Response syntax
#XBOOTINFO: <value>
The parameters and their defined values are the following:
- <value>
Integer.
When
<op>is0, it is an unsigned integer representing the firmware version of the active MCUboot slot, used by NSIB as a downgrade-protection counter.When
<op>is1, it is0if slots0is active and1if slots1is active.
Examples
Query the firmware version of the active MCUboot slot:
AT#XBOOTINFO=0
#XBOOTINFO: 1
OK
Query the active MCUboot slot:
AT#XBOOTINFO=1
#XBOOTINFO: 0
OK
Test command
AT#XBOOTINFO=?
Response syntax
#XBOOTINFO: (0,1)
Example
AT#XBOOTINFO=?
#XBOOTINFO: (0,1)
OK
Modem fault #XMODEM
The application monitors the modem status.
When the application detects a modem fault, it sends the #XMODEM unsolicited notification.
Unsolicited notification
The application sends the following unsolicited notification when it detects a modem fault:
#XMODEM: FAULT,<reason>,<program_count>
The parameters and their defined values are the following:
- <reason>
Integer. A hexadecimal integer indicating the reason of the modem fault.
- <program_count>
Integer. A hexadecimal integer indicating the address of the modem fault.
The application sends the following unsolicited notification when it shuts down libmodem:
#XMODEM: SHUTDOWN,<result>
The parameters and their defined values are the following:
- <result>
Integer. The result of the shutdown of libmodem.
The application sends the following unsolicited notification when it re-initializes libmodem:
#XMODEM: INIT,<result>
The parameters and their defined values are the following:
- <result>
Integer. The result of the re-initialization of libmodem.
Note
After libmodem is re-initialized, the MCU side must restart the current active service as follows:
Stopping the service. For example, disconnecting the TCP connection and closing the socket.
Connecting again using LTE.
Restarting the service. For example, opening the socket and re-establishing the TCP connection.
Memory statistics #XDBGSTATSMEM
Note
This AT command is Experimental.
Print heap and thread stack memory statistics to the log at the INF level.
Since this is using the logging as an output, you must enable logging first by issuing the AT#XLOG=1 command.
The following statistics are printed:
System heap (
mallocheap) - Free bytes, allocated bytes, and peak allocated bytes.Kernel heap (
k_mallocheap) - Free bytes, allocated bytes, and peak allocated bytes.
Set command
AT#XDBGSTATSMEM
The command prints memory statistics to the log and returns OK.
No memory information is returned in the AT response.
Read command
The read command is not supported.
Test command
The test command is not supported.
Example
Query memory statistics:
AT#XLOG=1
OK
AT#XDBGSTATSMEM
OK
These commands will print the following output in the log:
[00:00:36.270,965] <inf> sm_at: System heap stats:
[00:00:36.270,996] <inf> sm_at: free: 45844
[00:00:36.270,996] <inf> sm_at: allocated: 472
[00:00:36.271,026] <inf> sm_at: max. allocated: 472
[00:00:36.271,026] <inf> sm_at: Kernel heap stats:
[00:00:36.271,057] <inf> sm_at: free: 1892
[00:00:36.271,057] <inf> sm_at: allocated: 0
[00:00:36.271,057] <inf> sm_at: max. allocated: 1280