Skip to main content

RAK7432/RAK7434 AT Command Manual

Overview

This document applies to Analog to LoRaWAN Bridge products. The supported product models include RAK7432/RAK7434.

AT Command Syntax

The AT command must start with AT or at and ends with <CR> <LF>.

AT commands can be divided into:

  • Read commands - read the configuration or status of the device, which is in the format of AT+<x>
  • Write commands - write/modify the device configuration, which is in the format of AT+<x>=<m>:<n> The command name and parameters are separated by "=". If there are multiple parameters, the parameters are separated by ":".
  • Test commands - is the test command executable, which is in the format of AT+<x>=?

The response format of the command is usually:

ConditionResponse
Normal response with information<Response><CR><LF>OK<CR><LF>
Normal responseOK<CR><LF>
Response when an error occursERROR <Error code>:<Error packet><CR><LF>
NOTE

AT commands are not case-sensitive.

USB Configuration Interface

The devices are equipped with a standard USB interface for configuring via AT commands. The serial parameters are as follows:

ParameterValue
Baud rate115200
Data bit8
Stop bit1
VrificationNo

Common Errors

Error CodeDescription
ERROR 1Unsupported command
ERROR 2Syntax Error
ERROR 3Storage failure
ERROR 4System busy
ERROR 5Parameter format / number error
ERROR 6Insufficient resources
ERROR 7Parameter out of valid range

LoRaWAN Commands

  1. AT+DEVEUI

This command reads or modifies the LoRaWAN Device EUI. The command takes effect after restart.

OperationAT CommandResponse
ReadAT+DEVEUI<dev_eui>
OK
WriteAT+DEVEUI=<device_eui>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+DEVEUI=?OK
ParameterInformation
dev_euiDevice EUI: Hexadecimal characters, 16 bytes in length
  1. AT+REGION

This command reads or modifies the Working Frequency Region/Band of the device. It will take effect after restart.

OperationAT CommandResponse
ReadAT+REGION<region>
OK
WriteAT+REGION=<region>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+REGION=?OK
ParameterInformation
regionSupports frequency bands: EU433, CN470, CN470ALI, RU864, IN865, EU868, US915, AU915, KR920, AS923
  1. AT+JOINMODE

This command reads or modifies the LoRaWAN Activation Mode of the device. It will take effect after restart.

OperationAT CommandResponse
ReadAT+JOINMODE<mode>
OK
WriteAT+JOINMODE=<mode>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+JOINMODE=?OK
ParameterInformation
modeSupported activation mode: ABP or OTAA
  1. AT+PUBLIC

This command reads or modifies the LoRaWAN Public Settings of the device. The working mode is set to Public by default (1 value of the parameter). The modification will take effect after restart.

OperationAT CommandResponse
ReadAT+PUBLIC<x>
OK
WriteAT+PUBLIC=<x>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+PUBLIC=?OK
ParameterInformation
xIs the node working with the public LoRaWAN network?
0Not working in Public mode
1Working in Public mode
  1. AT+CLASS

This command reads or modifies the LoRaWAN working Class of the device. Effective immediately after modification.

OperationAT CommandResponse
ReadAT+CLASS<class>
OK
WriteAT+CLASS=<class>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+CLASS=?OK
ParameterInformation
classSupported device Classes:
AClass A
BClass B
CClass C
  1. AT+APPEUI

The APPEUI parameter is valid when OTAA is activated. The modification will take effect after restart.

OperationAT CommandResponse
ReadAT+APPEUI<app_eui>
OK
WriteAT+APPEUI=<app_eui>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+APPEUI=?OK
ParameterInformation
app_euiApplication EUI: Hexadecimal character, 16 bytes in length
  1. AT+APPKEY

The APPKEY parameter is valid in OTAA Activation Mode. The modification will take effect after restart.

OperationAT CommandResponse
ReadAT+APPKEY<app_key>
OK
WriteAT+APPKEY=<app_key>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+APPKEY=?OK
ParameterInformation
app_keyApplication Key: Hexadecimal character, 32 bytes in length
  1. AT+DEVADDR

The DEVADDR parameter is valid in ABP Activation Mode. The modification will take effect after restart.

OperationAT CommandResponse
ReadAT+DEVADDR<dev_addr>
OK
WriteAT+DEVADDR=<dev_addr>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+DEVADDR=?OK
ParameterInformation
dev_addrDevice Address: Hexadecimal character, 8 bytes in length
  1. AT+APPSKEY

The APPSKEY parameter is valid in ABP Activation Mode. The modification will take effect after restart.

OperationAT CommandResponse
ReadAT+APPSKEY<apps_key>
OK
WriteAT+APPSKEY=<apps_key>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+APPSKEY=?OK
ParameterInformation
apps_keyApplication Session Key: Hexadecimal character, 32 bytes in length
  1. AT+NWKSKEY

The NWKSKEY parameter is valid in ABP Activation Mode. The modification will take effect after restart.

OperationAT CommandResponse
ReadAT+NWKSKEY<nwks_key>
OK
WriteAT+NWKSKEY=<nwkskey>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+NWKSKEY=?OK
ParameterInformation
nwks_keyNetwork Session Key: Hexadecimal character, 32 bytes in length
  1. AT+ADR

Turn on/off the LoRaWAN dynamic rate adjustment function of the device, which is “on” by default. The modification will take effect immediately.

OperationAT CommandResponse
ReadAT+ADR<n>
OK
WriteAT+ADR=<n>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+ADR=?OK
ParameterInformation
nAdaptive Data Rate
0Disable ADR
1Enable ADR
  1. AT+DATARATE

Read/modify the LoRaWAN DataRate setting of the device, which is valid when the ADR function is turned off. The modification will take effect immediately.

OperationAT CommandResponse
ReadAT+DATARATE<n>
OK
WriteAT+DATARATE=<n>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+DATARATE=?OK
ParameterInformation
nLoRaWAN DataRate
0 ~ 7DataRate from 0 to 7 s is possible.
NOTE

The DataRate value and the default value are related to LoRaWAN regional parameters. Refer to Appendix: DataRate list of each region in this document.

  1. AT+CONFIRM

Turn on/off the LoRaWAN packet confirmation mechanic, which is set to be “on” by default. The modification will take effect immediately.

When the confirm function is enabled, the packets sent by the device will require the LoRa network server to send an ACK response. Unless a confirmation is received the device will resend the packet. For more information on the resending mechanic refer to 14. AT+RETRY.

OperationAT CommandResponse
ReadAT+CONFIRM<n>
OK
WriteAT+CONFIRM=<n>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+CONFIRM=?OK
ParameterInformation
nType of uplink packets
0Unconfirmed uplink packets
1Confirmed uplink packets
  1. AT+RETRY

Set the maximum number of retry attempts of the same LoRaWAN message, that will be valid when the confirm function is enabled. The default value is 3. The modification will take effect immediately.

When retry = n (n! = 1), if the device does not receive an ACK of a LoRaWAN message, it will resend the message until the ACK is received, or the retry counter expires.

OperationAT CommandResponse
ReadAT+RETRY<n>
OK
WriteAT+RETRY=<n>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+RETRY=?OK
ParameterInformation
nMax resend times
1 ~ 8The number of retries can be between 1 and 8
  1. AT+CHANNEL

When the LoRaWAN channel plan of the device is CN470 / US915 / AU915, it can be read/modified through this instruction. After execution of this command, all channels from “start ID” to “end ID” in the instruction parameters are turned on, and the other channels are turned off. The modification will take effect after restart.

When the device is working in one of the following bands this command can only be used for reading the parameters: EU433 / RU864 / IN865 / EU868 / KR920 / AS923.

OperationAT CommandResponse
ReadAT+CHANNEL<id>:<freq>:<drmin>:<drmax>
...
OK
Write
(Only valid when Region
is CN470 / US915 / AU915)
AT+CHANNEL=<startid>:<endid>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+CHANNEL=?OK
ParameterInformation
idChannel ID
freqCenter frequency of channel, unit: Hz
drminDataRate (Min)
drmaxDataRate (Max)
startidStart channel ID
endidStop channel ID
  1. AT+ADDCHANNEL

Add a LoRaWAN channel.

This instruction is valid when the working frequency band of LoRaWAN is EU433 / RU864 / EU868 / KR920 / AS923. The modification will take effect after restart.

OperationAT CommandResponse
WriteAT+ADDCHANNEL=<freq>:<drmin>:<drmax>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+ADDCHANNEL=?OK
ParameterInformation
freqCenter frequency of channel, unit: Hz
drminDataRate (Min)
drmaxDataRate (Max)
  1. AT+RMCHANNEL

Delete a LoRaWAN channel.

This instruction is valid when the working frequency band is EU433 / RU864 / EU868 / KR920 / AS923. The modification takes effect after restart.

OperationAT CommandResponse
WriteAT+RMCHANNEL=<freq>:<drmin>:<drmax>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+RMCHANNEL=?OK
ParameterInformation
freqCenter frequency of channel, unit: Hz
drminDataRate (Min)
drmaxDataRate (Max)
  1. AT+CHANMASK

Read the currently configured LoRaWAN Channel Mask. It is determined by the currently open channels. This instruction is “read-only”.

OperationAT CommandResponse
ReadAT+CHANMASK<chanmsk>
OK
TestAT+CHANMASK=?OK
ParameterInformation
chanmaskChannel mask: Hexadecimal string, right to left corresponding channel ID from low to high
  1. AT+TXPOWER

The TXPOWER parameter is valid when the ADR function is turned off. The modification will take effect immediately.

OperationAT CommandResponse
ReadAT+TXPOWER<txpwr>
OK
WriteAT+TXPOWER=<txpwr>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+TXPOWER=?OK
ParameterInformation
txpwrTransmit power (dBm, floating-point)
The value range is 0 ~ maxeirp, and the effective step size is 2dbm, that is, txpwr = maxeirp – 2 * n, and n is an integer greater than or equal to 0
The maxeirp is the Maximum EIRP (Equivalent Isotropic Radiated Power) defined for the specific band you are using in the LoRa Alliance documentation.
  1. AT+PINGNB

Set the PingSlot Number in each Beacon Period for Class B mode. The number of ping slots determines the period of the downlink packet of the device. The modification will take effect after restart.

OperationAT CommandResponse
ReadAT+PINGNB<N>
OK
WriteAT+PINGNB=<N>When the modification is successful:
OK
When modification fails:
ERROR <code>:<message>
TestAT+PINGNB=?OK
ParameterInformation
NPingSlot Number in Beacon Period:
1
2
4
8
16
32
64
128
  1. AT+LPTP

LoRa Private Transport Protocol (LPTP) is a RAK proprietary message splitting protocol, which can send data with a length exceeding the maximum permissible size, using multiple messages. As it is proprietary it only works with the RAK LoRa networks server built into our commercial gateways. It is “Off” by default. The modification will take effect immediately.

OperationAT CommandResponse
ReadAT+LPTP<x>
OK
WriteAT+LPTP=<x>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+LPTP=?OK
ParameterInformation
xLPTP status
0disabled
1enabled

Data Acquisition Setting Commands

  1. AT+AINPERIOD

The command is used to read or modify the analog data acquisition reporting period. The value is in seconds and the default value is 600s.

OperationAT CommandResponse
ReadAT+AINPERIOD<N>
OK
WriteAT+AINPERIOD=<N>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+AINPERIOD=?OK
ParameterInformation
NAnalog acquisition cycle
5 ~ 43200The value is in the range of 5 ~ 43200 seconds
  1. AT+AINVALUERANGE

Read or modify the actual values represented by the minimum and maximum values of the analog interface range. The analog data read by the system will be linearly converted and reported over LoRaWAN.

The default values are:


4-20 mA interface: 4-20


0-5 V interface: 0-5

OperationAT CommandResponse
ReadAT+AINVALUERANGE1:<MIN>:<MAX>
2:<MIN>:< MAX>
WriteAT+AINVALUERANGE=<channel>:<MIN>:<MAX>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+AINVALUERANGE=?OK
ParameterInformation
CHANNELThe analog input interface (AIN1=1/AIN2=2)
MIN VALUEAllowed range [-300,300]
MAX VALUEAllowed range [-300,300]
  1. AT+AINLPMODE

Set the analog data interface in low-power operation mode. When the low-power operation mode is enabled the power output and the analog data input interface will be turned off while there is no acquisition.

OperationAT CommandResponse
ReadAT+AINLPMODE<N>
OK
WriteAT+AINLPMODE=<N>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+AINLPMODE=?OK
ParameterInformation
NAINLPMODE status
0disabled
1enabled
  1. AT+AINWARMUP

When the analog data interface is working in low power consumption mode, the device needs to turn the acquisition circuit and warm up the sensor before data acquisition. The command allows setting the warm-up time. The value is in milliseconds (ms), and the default value is 1000 ms.

OperationAT CommandResponse
ReadAT+AINWARMUP<N>
OK
WriteAT+AINWARMUP=<N>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
TestAT+AINWARMUP=?OK
ParameterInformation
NWarm-up time, ms
  1. AT+AINREAD

Read the current analog input interface data.

OperationAT CommandResponse
ReadAT+AINREAD<N>
OK
ParameterInformation
channelAnalog input channel ID
1AIN1
2AIN2

System-Related Commands

  1. AT+TIMEZONE

With this command, the time zone of the device is set.

OperationAT CommandResponse
ReadAT+TIMEZONE<TZ>
OK
WriteAT+TIMEZONE=<TZ>When the modification is successful:
OK
When modification fails:
ERROR <code>:<message>
TestAT+TIMEZONE=?OK
ParameterInformation
TZUTC time zone: -12 ~ 12
  1. AT+VERSION

Read the firmware version of the device.

OperationAT CommandResponse
ReadAT+VERSIONWhen the modification is successful:
<br /><a>.<b>.<cccc>
OK
When modification fails:
ERROR <code>:<packet>
ParameterInformation
a.b.ccccFirmware Version, for example “1.1.0050”
  1. AT+SYSLOGLVL

Read or set the system log level. The module turns off the system log output by default. The user can modify the log output level through this command. The modification takes effect immediately after setting.

OperationAT CommandResponse
ReadAT+SYSLOGLVL<TZ>
OK
WriteAT+SYSLOGLVL=<level>OK
TestAT+SYSLOGLVL=?OK
ParameterInformation
levelOutput log level
0does not output any logs
1 ~ 6log with output level less than or equal to the value
  1. AT+ECHO

Turns local echo of the AT command-line interface on/off. Echo is turned off by default. It takes effect immediately after modification and is automatically turned off after a restart.

OperationAT CommandResponse
WriteAT+ECHO=<n>When the modification is successful:
OK
When modification fails:
ERROR <code>:<packet>
ParameterInformation
nLocal echo
0Disabled
1Enabled
  1. AT+RESTART Reboot the device.
OperationAT CommandResponse
WriteAT+RESTARTNull
  1. AT+FACTORY

The command restores the device to the factory settings. This operation will last for about 60 seconds. Do not cut off the power supply of the device before it automatically restarts.

OperationAT CommandResponse
WriteAT+FACTORYNull
  1. AT+SYSTIME

Show the real running time.

OperationAT CommandResponse
WriteAT+SYSTIME<time>
OK
ParameterInformation
timeTimestamp in UNIX format, in seconds
  1. AT+DATETIME

Show the synchronized with the LoRaWAN Network Server time. Needs LoRaWAN1.0.3 specification support from the server side.

OperationAT CommandResponse
ReadAT+DATETIME<datetime>
OK
ParameterInformation
datetimeDate / Time in YYYY/MM/DD hh:mm:ss
  1. AT+SYSINFO

This command gives the system information about the device.

OperationAT CommandResponse
ReadAT+SYSINFO<model>
<sn>
<version>
<vendor>
<copyright>
OK
ParameterInformation
modelModel info
snProduct SN info
versionFirmware version
vendorManufacturer info
copyrightCopyright info

Event Notification

When the working state of the module changes, an event notification will be output through the AT command-line interface. The event notification format is:

EVENT:[EVENT_ID]:[EVENT_MSG]:<ADDITIONAL_INFO>
EventDescription
EVENT_IDEvent ID
EVENT_MSGEvent name
ADDITIONAL_INFOAdditional information - Optional
Some events need to output additional information. Multiple additional information sets are separated by ":"

The module supports the following event notifications:

IDEVENT_MSGDescription
0STARTUPSystem startup complete
1JOIN_NETWORKSuccessful join to the LoRaWAN network
2LEAVE_NETWORKUnsuccessful join to the LoRaWAN network
5SYSTEM_WAKEUPSystem wakeup
6RESTARTSystem restart
  1. STARTUP Event - Appears after system initialization.
    • Message format:
EVENT:0:STARTUP
No additional information.
  1. JOIN_NETWORK Event - LoRaWAN network activation successful. It appears after OTAA joins successfully.
    • Message format:
EVENT:1:JOIN_NETWORK
No additional information.
  1. LORA_LEAVE_NETWORK Event - In OTAA activation mode, if eight consecutive uplink-confirmed packets do not receive a response, the LORA_LEAVE_NETWORK event will be triggered. After the LORA_LEAVE_NETWORK event is triggered, the module will stop sending LoRaWAN messages and start OTAA activation again.
    • Message format:
EVENT:2:LEAVE_NETWORK
No additional information.
  1. SYSTEM_WAKEUP Event - A module in a low-power state can be awakened by receiving input from the AT command line interface. After wakeup, the module will no longer enter low-power mode. If you want the module to enter low power mode again, use the command: AT+SLEEP\r\n
    • Message format:
EVENT:5:SYSTEM_WAKEUP
  1. RESTART Event - Triggered before the module restarts.
    • Message format:
EVENT:6:RESTART

LoRaWAN Data Format Definition

The basic message format is defined as follows:

Channel ID 1Type 1Data 1Channel ID 2Type 2Data 2
1Byte1BytenBytes1Byte1BytenBytes

The data adopts big-endian byte order, that is, the high byte is in Uplink

Message Data Format

The channel ID: analog input interface ID, interface AIN1: 0x01, interface AIN2: 0x02

type: fixed value 0x02, indicating analog input data.length of this type of data is 2 bytes of data: the analog input value of this channel*100. Length 2 bytes, signed integer,

  • Parsing example:

0x010401EF02040474

Channel ID 1type 1data 1
0x010x040x01EF
AIN1analog input data0x01EF=495=>4.95
Channel ID 2type 2data 2
0x020x040x0474
AIN2analog input data0x0474=1140=>11.4

Downlink Control

Basic structure message:

Channel ID 1type data
1Byte1BytenBytes

Remote Modification Configuration Channel

Channel ID: 0x80

Supported parameter types:

  • Data reporting cycle, 2 bytes, unit is second
  • Low power consumption mode, 1 word Section
  • Acquisition circuit warm-up time, 2-byte

Parsing example:

0x8001003C

Set the data reporting period to 60 seconds

60 = 0x003C

Cannel ID 1type data
0x800x010x003C

Appendix: Data Rate of Each Region

EU433/RU864/EU868/AS923

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: SF7 / 250 kHz11000
7FSK: 50 kbps50000
8 ~ 15RFU

CN470/KR920

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
6 ~ 15RFU

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