Skip to main content

RAK7200 AT Command Manual

To connect the RAK7200 module to a LoRa-P2P connection or a LoRaWAN network, the module must be configured and LoRa parameters must be set by sending AT commands. Listed below are the summary of the AT commands supported by the RAK7200 Module.

AT Command Syntax

The AT command is based on ASCII characters. In general, the AT Command starts with the prefix AT or at and ends with <CR><LF> (i.e. \r\n). The maximum length is 255 characters which includes the <CR><LF> characters at the end of the command. For the rest of the document, the "\r\n" part is omitted for the sake of clarity.

The AT commands can be classified in the following groups:

  • Read Command : Reads the current configuration or status of the module. The command name and the list of parameters are separated by = character. The <m> parameter is separated with its associated value <n> by the : character.
at+get_config=<m>:<n>
  • Write Command : Writes/Modifies the current configuration of the module. The command name and the list of parameters are separated by = character. The <m> parameter is separated with its associated value <n> by the : character.
at+set_config=<m>:<n>
  • Operational Commands : There are also commands that are neither read nor write commands. The purpose is to execute an action, for example:
at+send=lora:<m>:<n> // Sends data through the LoRa transceiver.
  • Special Command : The RAK811 UART port has two operational modes: configuration mode and data transmission mode. When switching from data transmission mode to configuration mode the command to be entered is +++ and does not contain terminators such as \ r and \ n.

After executing the command, a response is sent back to the external MCU. The usual reply has the following format:

OK [information]\r\n

NOTE

Only the read commands have information in the replied message, while Write commands do not have an informative description.

After sending a successful command to the module, the firmware developed, running in the external MCU, will expect at a minimum string of Ok\r\n. On the other hand, when the command is not successfully executed by the module, you will receive a response with the following format:

ERROR: [ErrCode]\r\n

Error Code Table

Error CodeDescription
1The last command received is an unsupported AT command.
2Invalid parameter in the AT command.
3There is an error when reading or writing the flash memory.
4There is an error when reading or writing through IIC bus.
5There is an error when sending data through the UART port.
80The LoRa transceiver is busy, could not process a new command.
81LoRa service is unknown. Unknown MAC command received by node. Execute commands that are not supported in the current state, such as sending at+join command in P2P mode.
82The LoRa parameters are invalid.
83The LoRa parameters are invalid.
84The LoRa data rate (DR) is invalid.
85The LoRa frequency and data rate are invalid.
86The device has not joined into a LoRa network.
87The length of the packet exceeded that maximum allowed by the LoRa protocol.
88Service is closed by the server. Due to the limitation of duty cycle, the server will send " SRV_MAC_DUTY_CYCLE_REQ" MAC command to close the service.
89This is an unsupported region code.
90Duty cycle is restricted. Due to duty cycle, data cannot be sent at this time until the time limit is removed.
91No valid LoRa channel could be found.
92No available LoRa channel could be found.
93Status is error. Generally, the internal state of the protocol stack is wrong.
94Time out reached while sending the packet through the LoRa transceiver.
95Time out reached while waiting for a packet in the LoRa RX1 window.
96Time out reached while waiting for a packet in the LoRa RX2 window.
97There is an error while receiving a packet during the LoRa RX1 window.
98There is an error while receiving a packet during the LoRa RX2 window.
99Failed to join into a LoRa network.
100Duplicated down-link message detected. A message with an invalid down-link count was received.
101Payload size is not valid for the current data rate (DR).
102There many down-link packets were lost.
103Address fail. The address of the received packet does not match the address of the current node.
104Invalid MIC was detected in the LoRa message.

Device AT Command

  1. at+version

This command is used for reading the version number of the current firmware.

OperationCommandResponse
Readat+versionOK <version number>

Parameter: NONE

Example:

at+version\r\n
OK 3.1.0.13

  1. at+help

This command is used to obtain all AT commands supported by the current firmware.

OperationCommandResponse
Readat+helpOK <all AT commands>

Parameter: NONE

Example:

at+help\r\n

OK.
*************************************************
===============AT Commands List==================
Device AT commands:
at+version
at+help
at+run
at+set_config=device:restart
at+set_config=device:sleep:X
at+set_config=device:boot
at+get_config=device:status

LoRaWAN AT commands:
at+join
at+send=lora:X:YYY
at+set_config=lora:region:XXX
at+get_config=lora:channel
at+set_config=lora:dev_eui:XXXX
at+set_config=lora:app_eui:XXXX
at+set_config=lora:app_key:XXXX
at+set_config=lora:dev_addr:XXXX
at+set_config=lora:apps_key:XXXX
at+set_config=lora:nwks_key:XXXX
at+set_config=lora:join_mode:X
at+set_config=lora:work_mode:X
at+set_config=lora:ch_mask:X:Y
at+set_config=lora:class:X
at+set_config=lora:confirm:X
at+set_config=lora:dr:X
at+set_config=lora:tx_power:X
at+set_config=lora:adr:X
at+set_config=lora:send_interval:X:Y
at+get_config=lora:status

Sensor AT commands:
at+set_config=device:gps_timeout:X
at+set_config=device:gps_format:X
at+set_config=device:voltage:X
at+set_config=device:gps:X
at+set_config=device:acc:X
at+set_config=device:magn:X
at+set_config=device:gyro:X
===================List End======================
*************************************************

  1. at+set_config=device:restart

This command is used for restarting the device.

OperationCommandResponse
Readat+set_config=device:restart

Parameter: NONE

Example:

OK,restart ...


========================================================
______ ___ _ __ _ _ _ _
| ___ \/ _ \ | | / / | | | (_) | |
| |_/ / /_\ \| |/ / | | | |_ _ __ ___| | ___ ___ ___
| /| _ || \ | |/\| | | '__/ _ \ |/ _ \/ __/ __|
| |\ \| | | || |\ \ \ /\ / | | | __/ | __/\__ \__ \
\_| \_\_| |_/\_| \_/ \/ \/|_|_| \___|_|\___||___/___/
========================================================
********************************************************
RAK7200 version:3.1.0.13
********************************************************
========================================================

  1. at+set_config=device:sleep:<status>

This command is used for changing the current state of the device between sleep and wake up mode.

OperationCommandResponse
Writeat+set_config=device:sleep:<status>OK<STATUS>

Parameter:

Status0: wake up
1: sleep

Example:

at+set_config=device:sleep:1\r\n
OK Sleep

at+set_config=device:sleep:0\r\n
OK Wake Up

  1. at+get_config=device:<status>

This command is used for obtaining the status of the device.

OperationCommandResponse
Readat+get_config=device:statusOK<information>

Parameter: None

Example:

at+get_config=device:status\r\n
OK.
*************************************************
===============Device Status List================
Board Core: S76G_B
MCU: STM32L073RZ
LoRa chip: SX1276

Battery Voltage = 3.811 V
Support Gps:true
gps_timeout: 100s
gps_format:standard LPP format
No signal with Satellite.

MPU9250 sensor:
Acceleration(g) of X,Y,Z:
0.00,0.00,0.00
Gyro(degrees/s) of X,Y,Z:
0.00,0.00,0.00
Magnetometer(uT) of X,Y,Z:
0.00,0.00,0.00

===================List End======================
*************************************************

LoRaWAN Type AT Command

  1. at+join

This command is used for joining to the LoRaWAN network.

OperationCommandResponse
at+joinOK Join Success

Parameter: NONE

Example:

at+join\r\n
OK
[LoRa]:Joined Success!
  1. at+send=lora:<port>:<data>

This command is used for sending data via LoRaWAN.

OperationCommandResponse
at+send=lora:<port>:<data>OK

Parameter:

portSending port of LoRa. The value range is 1-223.
dataThe sending data format is in hexadecimal format. The possible values are between 00-FF. The module will internally cast every two characters into a byte before sending it to the LoRa transceiver. The maximum length varies depending on the band frequency and DR (LoRaWAN standard). Refer to Appendix III.

Example:

When sending data as unconfirmed uplink:

at+send=lora:1:5A00\r\n
[LoRa]: RUI_MCPS_UNCONFIRMED send success
OK

When sending data as confirmed uplink:

at+send=lora:1:5A00\r\n
OK
at+recv=0,-36,8,0
NOTE

When sending a confirmed message, you will receive an ACK response, i.e. at+recv=.... In 0, -105, -12, 0, 0 stands for the LoRa port, -105 stands for the RSSI, -12 stands for the SNR, and 0 stands for the length of the data (no valid data in ACK).


  1. at+set_config=lora:region:<region>

This command is used for setting the appropriate working frequency band.

OperationCommandResponse
Writeat+set_config=lora:region:<region>OK

Parameter:

regionEU433, CN470, IN865, EU868, US915, AU915, KR920, AS923. The default is EU868.

Example:

at+set_config=lora:region:EU868\r\n
Selected LoRaWAN 1.0.2 Region: EU868
Band switch success
OK
NOTE

In the AS923 frequency band, the supported frequency plan is "as2" and dwell is set to 1.


  1. at+get_config=lora:channel

This command is used for reading all the LoRa channel information for the device's current region.

OperationCommandResponse
Readat+get_config=lora:channelOK <channel information>

Parameter: NONE

Example:

  • EU868 region
at+get_config=lora:channel\r\n
OK 0,off,0,0,0; 1,off,0,0,0; 2,off,0,0,0; 3,off,0,0,0; 4,off,0,0,0; 5,off,0,0,0; 6,off,0,0,0; 7,off,0,0,0; 8,off,0,0,0; 9,off,0,0,0; 10,off,0,0,0; 11,off,0,0,0; 12,off,0,0,0; 13,off,0,0,0; 14,off,0,0,0; 15,off,0,0,0
NOTE

With “*0,on,868100000,0,5” as an example,channel parameter analysis:

  • *” at the beginning if the channel is open;
  • 0” is the channel ID;
  • on” indicates the current status of the channel;
  • 868100000” is the actual frequency of the channel,unit is Hz;
  • 0,5” indicates the DR of the channel, DR0~DR5.

  1. at+set_config=lora:ch_mask:<channel_number>:<status>

This command is used for switching a channel (turn on or off) in the current region.

OperationCommandResponse
Writeat+set_config=lora:ch_mask:<channel_number>:<status>OK

Parameter:

channel_numberChannel number
status0: off
1: on

Example:

at+set_config=lora:ch_mask:0:0\r\n
OK

  1. at+set_config=lora:dev_eui:<dev_eui>

This command is used for setting the Device EUI parameter for the LoRaWAN OTAA mode.

OperationCommandResponse
Writeat+set_config=lora:dev_eui:<dev_eui>OK

Parameter:

dev_euiDevice EUI

Example:

at+set_config=lora:dev_eui:3530353064377716\r\n
OK

  1. at+set_config=lora:app_eui:<app_eui>

This command is used for setting the Application EUI parameter for the LoRaWAN OTAA mode.

OperationCommandResponse
Writeat+set_config=lora:app_eui:<app_eui>OK

Parameter:

app_euiApplication EUI

Example:

at+set_config=lora:app_eui:0000000000000001\r\n
OK

  1. at+set_config=lora:app_key:<app_key>

This command is used for setting the Application Key parameter for the LoRaWAN OTAA mode.

OperationCommandResponse
Writeat+set_config=lora:app_key:<app_key>OK

Parameter:

app_keyApplication Key

Example:

at+set_config=lora:app_key:841986913ACD00BBC2BE2479D70F3228\r\n
OK

  1. at+set_config=lora:dev_addr:<dev_addr>

This command is used for setting the Device Address parameter for the LoRaWAN ABP mode.

OperationCommandResponse
Writeat+set_config=lora:dev_addr:<dev_addr>OK

Parameter:

dev_addrDevice Address

Example:

at+set_config=lora:dev_addr:260125D7\r\n
OK

  1. at+set_config=lora:apps_key:<apps_key>
OperationCommandResponse
Writeat+set_config=lora:apps_key:<apps_key>OK

Parameter:

apps_keyApplication Session Key

Example:

at+set_config=lora:apps_key:841986913ACD00BBC2BE2479D70F3228\r\n
OK

  1. at+set_config=lora:nwks_key:<nwks_key>

This command is used for setting the Network Session Key parameter for the LoRaWAN ABP mode.

OperationCommandResponse
Readat+set_config=lora:nwks_key:<nwks_key>OK

Parameter:

nwks_keyNetwork Session Key

Example:

at+set_config=lora:nwks_key:69AF20AEA26C01B243945A28C9172B42\r\n
OK

  1. at+set_config=lora:join_mode:<mode>

This command is used for switching the LoRaWAN access mode between the OTAA and the ABP mode.

OperationCommandResponse
Writeat+set_config=lora:join_mode:<mode>OK

Parameter:

modeActivation mode
0: OTAA
1: ABP
The default is OTAA.

Example:

at+set_config=lora:join_mode:1\r\n
join_mode:OTAA
OK

  1. at+set_config=lora:class:<class>

This command is used for setting LoRaWAN class to Class A, Class B, or Class C.

OperationCommandResponse
Writeat+set_config=lora:class:<class>OK

Parameter:

class0: Class A
1: Class B (Not supported at this time)
2: Class C
The default is Class A.

Example:

at+set_config=lora:class:0\r\n
OK

  1. at+set_config=lora:confirm:<type>

This command is used for setting the type messages to be sent: Confirmed/Unconfirmed.

OperationCommandResponse
Writeat+set_config=lora:confirm:<type>OK

Parameter:

type0: unconfirm type
1: confirm type
The default is unconfirm type.

Example:

at+set_config=lora:confirm:0\r\n
OK
  1. at+set_config=lora:dr:<dr>

This command is used to set the data rate (DR) of LoRa.

OperationCommandResponse
Writeat+set_config=lora:dr:<dr>OK

Parameter:

drThe data rate of LoRa is related to the current region. In most of the LoRa areas, it is common to use 0 to 5. Detailed reference can be made to LoRaWAN 1.0.2 specification.

  1. at+set_config=lora:tx_power:<tx_power>

This command is used for setting the level of the RF transmission power of the LoRa transceiver. The unit is in dBm.

OperationCommandResponse
Writeat+set_config=lora:tx_power:<tx_power>OK

Parameter:

tx_powerLoRa transmit power level varies depending on frequency band and DR. Refer to the LoRaWAN 1.0.2 specification or Appendix II for details.
The default is 0.

Example:

at+set_config=lora:tx_power:0\r\n
OK

  1. at+set_config=lora:adr:<status>

This command is used for setting (turn on/off) the ADR feature of the LoRa communication.

OperationCommandResponse
Writeat+set_config=lora:adr:<status>OK

Parameter:

status0: Turn off
1: Turn on
The default is on.

Example:

at+set_config=lora:adr:1\r\n
OK

  1. at+get_config=lora:status

This command is used for getting all of the information related to the current LoRa status (except channel information).

OperationCommandResponse
Readat+get_config=lora:statusOK <lora status detail>

Parameter: NONE

Example:

OK.
*************************************************
===============Device Status List================
Board Core: S76G_B
MCU: STM32L073RZ
LoRa chip: SX1276

Battery Voltage = 4.298 V
Support Gps:true
gps_timeout: 100s
gps_format:standard LPP format
No signal with Satellite.

MPU9250 sensor:
Acceleration(g) of X,Y,Z:
0.02,0.01,1.02
Gyro(degrees/s) of X,Y,Z:
-1.01,0.84,0.83
Magnetometer(uT) of X,Y,Z:
20.85,63.15,51.75

===================List End======================
*************************************************

  1. at+set_config=lora:send_interval:<status>:<interval>

This command is used for setting the time interval for sending data.

OperationCommandResponse
Writeat+set_config=lora:send_interval:<status>:<interval>OK

Parameter:

statusEnable/disable the mechanism for sending data in intervals.
0: the device will not send data automatically.
1: the device will send data every 'interval' seconds.
intervalTime in seconds. This parameter is only valid if 'status' is set to 1.

Example:

at+set_config=lora:send_interval:1:120\r\n
Start auto send data with sleep.
OK

Sensor AT command

  1.  at+set_config=device:gps_timeout:<time>  

This command is used to set the timeout of searching GPS satellite.

OperationCommandResponse
Writeat+set_config=device:gps_timeout:<time>OK

Parameter:

timeTime in seconds.

Example

at+set_config=device:gps_timeout:120\r\n
OK

  1.  at+set_config=device:gps_format:<accuracy>

This command is used to configure the GPS payload format.

OperationCommandResponse
Writeat+set_config=device:gps_format:<accuracy>OK

Parameter:

accuracy0: LPP format which is only 4 decimal digits accuracy
1: 6 decimal digits accuracy
The default is 0.

Example

at+set_config=device:gps_format:0\r\n
OK

  1.  at+set_config=device:<parameter>:<status>  

This command is used to set a certain sensor’s status.

OperationCommandResponse
Writeat+set_config=device:<parameter>:<status>OK

Parameter:

parametergps = GPS
acc = Accelerate
magn = Magnetic
gyro = Gyroscope
voltage = Voltage
status0: close
1: open

Example

at+set_config=device:voltage:1\r\n
open voltage detected.
OK

Appendix I: Data Rate by Region

EU868/AS923/US915
Data RateConfigurationIndicative Physical Bit Rate [bit/s]
0LoRa: SF10/ 125 kHz980
1LoRa: SF9/ 125 kHz1760
2LoRa: SF8/ 125 kHz3125
3LoRa: SF7/ 125 kHz5470
4LoRa: SF8/ 500 kHz12500
5 ~ 7RFU-
8LoRa: SF12/ 500 kHz980
9LoRa: SF11/ 500 kHz1760
10LoRa: SF10/ 500 kHz3900
11LoRa: SF9/ 500 kHz7000
12LoRa: SF8/ 500 kHz12500
13LoRa: SF7/ 500 kHz21900
14 ~ 15RFU-

AU915
Data RateConfigurationIndicative Physical Bit Rate [bit/s]
0LoRa: SF12/ 125 kHz250
1LoRa: SF11/ 125 kHz440
2LoRa: SF10/ 125 kHz980
3LoRa: SF9/ 125 kHz1760
4LoRa: SF8/ 125 kHz3125
5LoRa: SF7/ 125 kHz5470
6LoRa: SF8/ 500 kHz12500
7RFURFU
8LoRa: SF12/ 500 kHz980
9LoRa: SF11/ 500 kHz1760
10LoRa: SF10/ 500 kHz3900
11LoRa: SF9/ 500 kHz7000
12LoRa: SF8/ 500 kHz12500

IN865
Data RateConfigurationIndicative Physical Bit Rate [bit/s]
0LoRa: SF12/ 125 kHz250
1LoRa: SF11/ 125 kHz440
2LoRa: SF10/ 125 kHz980
3LoRa: SF9/ 125 kHz1760
4LoRa: SF8/ 125 kHz3125
5LoRa: SF7/ 125 kHz5470
6RFURFU
7FSK: 50 kbps50000
8 ~ 15RFURFU

Appendix II: TX Power by Region

EU868

By default, MaxEIRP is considered to be +16 dBm.

TXPowerConfiguration (EIRP)
0MaxEIRP
1MaxEIRP - 2 dB
2MaxEIRP - 4 dB
3MaxEIRP - 6 dB
4MaxEIRP - 8 dB
5MaxEIRP - 10 dB
6MaxEIRP - 12 dB
7MaxEIRP - 14 dB
8 ~ 15RFU

US915
TXPowerConfiguration (Conducted Power)
030 dBm - 2*TXpower
128 dBm
226 dBm
3 ~ 9-
1010 dBm
11 ~ 15RFU
AU915

By default, MaxEIRP is considered to be +30 dBm.

TXPowerConfiguration (EIRP)
0MaxEIRP
1 ~ 10MaxEIRP - 2*TXPower
11 ~ 10RFU

KR920

By default, MaxEIRP is considered to be +14 dBm.

TXPowerConfiguration (EIRP)
0MaxEIRP
1MaxEIRP - 2 dB
2MaxEIRP - 4 dB
3MaxEIRP - 6 dB
4MaxEIRP - 8 dB
5MaxEIRP - 10 dB
6MaxEIRP - 12 dB
7MaxEIRP - 14 dB
8 ~ 15RFU

AS923

By default, Max EIRP shall be 16 dBm.

TXPowerConfiguration (EIRP)
0MaxEIRP
1MaxEIRP - 2 dB
2MaxEIRP - 4 dB
3MaxEIRP - 6 dB
4MaxEIRP - 8 dB
5MaxEIRP - 10 dB
6MaxEIRP - 12 dB
7MaxEIRP - 14 dB
8 ~ 15RFU
IN865

By default, MaxEIRP is considered to be 30 dBm.

TXPowerConfiguration (EIRP)
0MaxEIRP
1MaxEIRP - 2 dB
2MaxEIRP - 4 dB
3MaxEIRP - 6 dB
4MaxEIRP - 8 dB
5MaxEIRP - 10 dB
6MaxEIRP - 12 dB
7MaxEIRP - 14 dB
8MaxEIRP - 16 dB
9MaxEIRP - 18 dB
10MaxEIRP - 20 dB
11 ~ 15RFU

Appendix III: Maximum Transmission Load by Region

NOTE

M in the following list is the length with MAC header, N is the length without MAC header, and the maximum sending data length is N.

EU868
Data RateMN
05951
15951
25951
3123115
4250242
5250242
6250242
7250242
8 ~ 15Not DefinedNot Defined

US915
Data RateMN
01911
16153
2133125
3250242
4250242
5 ~ 7Not DefinedNot Defined
86153
9137129
10250242
11250242
12250242
13250242
14 ~ 15Not DefinedNot Defined

AU915
Data RateMN
05951
15951
25951
3123115
4250242
5250242
6250242
7Not DefinedNot Defined
86153
9137129
10250242
11250242
12250242
13250242
14 ~ 15Not DefinedNot Defined

KR920
Data RateMN
05951
15951
25951
3123115
4250242
5250242
6 ~ 15Not DefinedNot Defined

AS923
Data RateUplink MAC Payload Size (M)Downlink MAC Payload Size (M)
UplinkDwellTime = 0UplinkDwellTime = 1DownlinkDwellTime = 0DownlinkDwellTime = 1
059N/A59N/A
159N/A59N/A
259195919
31236112361
4250133250133
5250250250250
6250250250250
7250250250250
8RFURFU

IN865
Data RateMN
05951
15951
25951
3123115
4250242
5250242
6250242
7250242
8 ~ 15Not DefinedNot Defined