AT Command Manual
Overview
AT command is the initial setting in the default serial port used on RUI3 devices. The default baud rate is 115200.
When communicating through AT commands with the WisDuo modules, it is important to always wait for the response from the WisDuo module before sending the next command. Some AT commands respond not only immediately, but also with a second asynchronous event response that must be handled before the next command can be processed.
For users that write the firmware for the host MCU with Arduino or PlatformIO, it is recommended to use a communication library. The RUI3-Arduino-Library is a helper for the AT command communication between a RUI3 based RAKwireless WisDuo module and an Arduino based host MCU. This library can be installed using the Arduino IDE library manager. Library documentation. Library examples
RUI3-Supported RAK Modules
- RAK4630
- RAK4631-R
- RAK3172 or RAK3172-T
- RAK3272S
- RAK3372 / RAK3172 Evaluation Board
- RAK3172-SiP
- RAK3272-SiP
- RAK11720
- RAK11721
- RAK11722
RUI3 AT Command Format
The AT commands have the standard format AT+XXX
, with XXX
denoting the command.
There are four available command behaviors:
AT+XXX?
provides a short description of the given command, for example,AT+DEVEUI?
.AT+XXX
is used to run a command, such asAT+JOIN
.AT+XXX=?
is used to get the value of a given command, for example,AT+CFS=?
.AT+XXX=<value>
is used to provide a value to a command, for example,AT+CFM=1
.
The output format is as below:
AT+XXX=<value><CR><LF>
<CR><LF><Status<CR><LF>
<CR>
stands for “carriage return” and<LF>
stands for “line feed”.- The
<value><CR><LF>
output is returned whenever the “helpAT+XXX?
” or the “getAT+XXX=?
” commands are run.
When no value is returned, the <value><CR><LF>
output is not returned at all. Every command (except for ATZ
used for MCU reset) returns a status string, which is preceded and followed by <CR><LF>
in a <CR><LF><Status<CR><LF>
format.
The possible status codes are:
OK
: command runs correctly without error.AT_ERROR
: generic error.AT_PARAM_ERROR
: a parameter of the command is wrong.AT_BUSY_ERROR
: the LoRa network is busy, so the command has not been completed.AT_TEST_PARAM_OVERFLOW
: the parameter is too long.AT_NO_CLASSB_ENABLE
: End-node has not yet switched in Class B.AT_NO_NETWORK_JOINED
: the LoRa network has not been joined yet.AT_RX_ERROR
: error detection during the reception of the command.
More details on each command description and examples are given in the remainder of this section.
Content
- AT Command Manual
- Overview
- Content
- General Commands
- Low Power
- Serial AT Command
- Bootloader Commands
- LoRaWAN Keys and IDs
- LoRaWAN Joining and Sending
- LoRaWAN Network Management
- Class B Mode
- Asynchronous Events
- LoRaWAN Information
- LoRaWAN Regional Commands
- LoRaWAN Multicast Group
- P2P Instructions
- AT+NWM
- AT+PFREQ
- AT+PSF
- AT+PBW
- AT+PCR
- AT+PPL
- AT+PTP
- AT+PBR
- AT+PFDEV
- AT+PSEND
- AT+CAD
- AT+PRECV
- AT+ENCRY
- AT+ENCKEY
- AT+PCRYPT
- AT+PKEY
- AT+CRYPIV
- AT+P2P
- AT+IQINVER
- AT+SYNCWORD
- AT+RFFREQUENCY
- AT+TXOUTPUTPOWER
- AT+BANDWIDTH
- AT+SPREADINGFACTOR
- AT+CODINGRATE
- AT+PREAMBLELENGTH
- AT+SYMBOLTIMEOUT
- AT+FIXLENGTHPAYLOAD
- RF Test
General Commands
This section describes the generic commands related to the device.
AT
Description: Attention
This command is used to check that the communication is working properly.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT | - | - | OK |
AT?
Description: Short help
This command provides short help for all the supported commands.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT? | - | - AT+<CMD>? : help on <CMD> - AT+<CMD> : run <CMD> - AT+<CMD>=<value> : set the value - AT+<CMD>=? : get the value - followed by the details of all commands | OK |
ATE
Description: AT Command Echo
This command is used to see the AT command input on the Serial Terminal.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT | - | - | OK |
AT? | - | ATE : toggle the AT Command echo | OK |
Example:
ATE
OK
ATZ
Description: MCU Reset
This command is used to trigger a reset on the module.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
ATZ? | - | ATZ : triggers a reset on the MCU. | OK |
ATZ | - | No return value and return code. The module resets. | Shows device information |
Example:
ATZ
RAKwireless RAK3172
------------------------------------------------------
Version: RUI_4.0.4_RAK3172-E
Current Work Mode: LoRa P2P.
ATR
Description: Restore default parameters
This command is used to restore all parameters to the initial default values.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
ATR? | - | ATR : restore default parameters | OK |
ATR | - | No return value. | OK |
AT+SN
Description: Serial number
This command can read the device serial number.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+SN? | - | AT+SN : get the serial number of the device (max 18 char) | OK |
AT+SN=? | - | <1-18char> | OK |
Example:
AT+SN=?
9181004E20900057
OK
AT+BAT
Description: Battery level
This command is used to access the battery level.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+BAT? | - | AT+BAT : get the battery level (volt) | OK |
AT+BAT=? | - | AT+BAT = <float> | OK |
Example:
AT+BAT=?
AT+BAT=2.971191
OK
AT+BUILDTIME
Description: Build time of the firmware
This command is used to access the build date and time of the firmware.
Command | Input Parameter | Return value | Return code |
---|---|---|---|
AT+BUILDTIME? | - | AT+BUILDTIME : get the build time of the firmware | OK |
AT+BUILDTIME=? | - | AT+BUILDTIME =date - time of build | OK AT_BUSY_ERROR |
Example:
AT+BUILDTIME=?
AT+BUILDTIME=20220324-153044
OK
AT+REPOINFO
Description: Repo information
This command is used to access the Repo Information of the firmware.
Command | Input Parameter | Return value | Return code |
---|---|---|---|
AT+REPOINFO? | - | AT+REPOINFO : get the commit ID of the firmware | OK |
AT+REPOINFO=? | - | AT+REPOINFO =firmware repo information | OK |
Example:
AT+REPOINFO=?
AT+REPOINFO=713fbcca:6ecbb45f:e198f620:b43f5395:4a6defb9:c9438443:5ccb8eec:70e5bb3f
OK
AT+VER
Description: Version of the firmware
This command is used to access the version of the firmware.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+VER? | - | AT+VER : get the version of the firmware | OK |
AT+VER=? | - | AT+VER =firmware version | OK |
Example:
AT+VER=?
AT+VER=RUI_4.1.0_RAK4631
OK
AT+CLIVER
Description: Version of the AT Command
This command is used to access the version of the AT command.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+CLIVER? | - | AT+CLIVER : get the version of the AT command | OK |
AT+CLIVER=? | - | AT+CLIVER =x.y.z | OK |
Example:
AT+CLIVER=?
AT+CLIVER=1.5.2
OK
AT+APIVER
Description: Version of the API
This command is used to access the version of the RUI API.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+APIVER? | - | AT+APIVER : get the version of the RUI API | OK |
AT+APIVER=? | - | AT+APIVER =x.y.z | OK |
Example:
AT+APIVER=?
AT+APIVER=3.0.0
OK
AT+HWMODEL
Description: The string of the hardware model
This command is used to access the string of the hardware model.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+HWMODEL? | - | AT+HWMODEL : get the string of the hardware model | OK |
AT+HWMODEL=? | - | AT+HWMODEL =module model | OK |
Example:
AT+HWMODEL=?
AT+HWMODEL=rak4631
OK
AT+HWID
Description: The string of the hardware ID
This command is used to access the string of the hardware mode.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+HWID? | - | AT+HWID : get the string of the hardware ID | OK |
AT+HWID=? | - | AT+HWID =module hw ID | OK |
Example:
AT+HWID=?
AT+HWID=nrf52840
OK
AT+ALIAS
Description: Alias name of the device
This command allows the user to set an alias name for the device.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+ALIAS? | - | AT+ALIAS : add an alias name to the device | OK |
AT+ALIAS=? | - | <string, 16char> | OK |
AT+ALIAS=<Input> | <string, 16char> | - | OK AT_PARAM_ERROR |
Example:
AT+ALIAS=RAK
OK
AT_PARAM_ERROR
is returned when setting wrong or malformed value.<string, 16char>
: set of 16-character string.
AT+SYSV
Description: System voltage of the device
This command allows the user to get the System Voltage.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+SYSV? | - | AT+SYSV : get the System Voltage | OK |
AT+SYSV=? | - | <float> | OK |
Example:
AT+SYSV=?
AT+SYSV=3.318750
OK
AT+BLEMAC
This command is ONLY available on the RAK4630 and RAK11720 modules.
Description: BLE Mac Address of the device
This command allows the user to get or set the BLE Mac address.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+BLEMAC? | - | AT+BLEMAC : get or set the BLE Mac address | OK |
AT+BLEMAC=? | - | <string>:<string>:<string>:<string>:<string>:<string> | OK |
AT+BLEMAC=<Input> | <string, 12 char> | <string> | OK |
Example:
AT+BLEMAC=?
AT+BLEMAC=d1:e0:f2:4d:58:1a
OK
AT+BOOTVER
Description: RUI bootloader version of the device
This command allows the user to get the version of RUI bootloader.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+BOOTVER? | - | AT+BOOTVER : get the version of RUI bootloader | OK |
AT+BOOTVER=? | - | <string> | OK |
AT+BOOTVER=<Input> | - | RUI Bootloader Version | OK |
Example:
AT+BOOTVER=?
AT+BOOTVER=************
OK
Low Power
AT+SLEEP
Description: Sleep mode
This command enables sleep mode.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+SLEEP | - | - | OK |
AT+SLEEP? | - | AT+SLEEP : enter sleep mode for a period of time (ms) | OK |
AT+SLEEP=<Input> | <integer> | - | OK AT_PARAM_ERROR |
Example:
AT+SLEEP=1000
OK
AT+SLEEP
command with no parameter will enable sleep mode continuously without timeout period.AT_PARAM_ERROR
is returned when setting wrong or malformed value.<Input>
: 1 decimal integer and the range of values is 1~(232 -1).
AT+LPM
Description: Low power mode of the device
This command provides a way to enable/disable low power mode. LPM makes the device sleep automatically after sending AT commands. This eliminates the need to send AT+SLEEP
.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+LPM? | - | AT+LPM : get or set the low power mode (0=OFF; 1=ON) | OK |
AT+LPM=? | - | <string> | OK |
AT+LPM=<Input> | 0 or 1 | - | OK AT_PARAM_ERROR |
Example:
AT+LPM=?
AT+LPM=0
OK
AT_PARAM_ERROR
is returned when setting wrong or malformed value.<string>
: either "0" or "1"
AT+LPMLVL
The two sleep modes can ONLY be selected with RAK3172. This AT command has NO EFFECT on other modules.
Description: Sleep level for low power mode
This command sets the low power mode level of the RAK3172 module in LPM. Stop2 Mode is more optimized for low current consumption compared to Stop1 Mode but it will not allow you to wake up using UART1. On Stop1 Mode, both UART1 and UART2 can wake up the device from LPM.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+LPMLVL? | - | AT+LPMLVL : get or set the low power mode level (1 = STOP1 Mode; 2 = STOP2 Mode) | OK |
AT+LPMLVL=? | - | 1 or 2 | OK |
AT+LPMLVL=<Input> | 1 or 2 | - | OK AT_PARAM_ERROR |
Example:
AT+LPMLVL=?
AT+LPMLVL=1
OK
AT_PARAM_ERROR
is returned when setting wrong or malformed value.- This command is only applicable to RAK3172 devices.
Serial AT Command
These commands are related to device serial configurations.
AT+LOCK
Description: Lock the AT Command serial port
This command locks the AT command serial port.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+LOCK? | - | AT+LOCK : lock the serial port | OK |
AT+LOCK or AT+LOCK= | - | - | - |
- If you input the
AT+LOCK
orAT+LOCK=
command, it will lock the serial port. - The default password is '00000000' and can be changed via the
AT+PWORD
command.
Example:
AT
OK
AT+LOCK
AT+VER=?
COMMAND_LOCKED
00000000
AT+VER=?
3.1.0-p1_21q4_rc2.50
OK
AT+PWORD
Description: Set the AT Command serial port password
This command sets the password for locking the AT command serial port.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+PWORD? | - | AT+PWORD : set the serial port locking password | OK |
AT+PWORD=<input> | <1-8 character> | - | OK |
Example:
AT+PWORD=~!@pword
OK
- Any printable characters.
<Input>
: 1-8 characters.
AT+BAUD
Description: Set the serial port baud rate
This command sets the serial port baud rate.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+BAUD? | - | AT+BAUD : get or set the serial port baud rate | OK |
AT+BAUD=<Input> | <integer> | - | OK AT_PARAM_ERROR |
Example:
AT+BAUD=?
AT+BAUD=115200
OK
AT+BAUD=921600
AT_PARAM_ERROR
- The last configured baudrate will be retained to the module even with reset or power recycle.
AT_PARAM_ERROR
is returned when setting wrong or malformed value.<Input>
: 1 decimal integer and the range of values is 1~232.
AT+ATM
Description: AT Command mode
This command provides a way to switch to AT command mode.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+ATM? | - | AT+ATM : switch to AT command mode | OK |
AT+ATM | - | - | OK |
AT Command mode is the default serial port setting of RUI3 devices.
Bootloader Commands
This section describes the bootloader commands related to the device.
AT+BOOT
Description: Bootloader mode
This command causes the device to enter Bootloader mode to upgrade firmware.
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+BOOT? | - | AT+BOOT : enter bootloader mode for firmware upgrade | OK |
AT+BOOT or AT+BOOT= | - | <BOOT MODE> |
Example:
AT+BOOT
<BOOT MODE>
To escape BOOT MODE, execute at+run
command. This is will end the BOOT MODE then restart the RUI3 device.
AT_BUSY_ERROR
is returned when the bootloader process is already running.
AT+VER
Description: Version of the Bootloader (Bootloader only).
This command is used to access the version of the bootloader (Bootloader only).
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+VER=? | - | RUI_BOOT_0.6_STM32WLE5CC | - |
Example:
AT+VER=?
RUI_BOOT_0.6_STM32WLE5CC