Contens

1. Introduction

Dragino LoRaWAN End Node support two types of AT Commands and Downlink Commands:

  • Common Commands: They should be available for each sensor, such as: change uplink interval, reset device.
  • Sensor Related Commands: Only for special sensor, such as control relay, poll RS485 device.

This page shows the common commands since Dragino LoRaWAN stack DR-LWS-005. Make sure the end node support stack higher than DR-LWS-005 before checking this page.
 

2. How to use AT Commands or Downlink command

  • For AT Command , See Devices User Manual for Device. The user manual can be found in each product page of Dragino Official Website
  • For LoRaWAN Downlink: The gateway transfer downlink command in HEX format. This page shows the HEX format downlink code for each command. but some servers use base64 as downlink code. Below are reference for how to use downlink command:

3. Support End Node and firmware version

                                                       Dragino STM32 base hardware Firmware / LoRaWAN stack list
ModelDescriptionFirmware Version <--> Stack Version
LSN50-v1LSN50-V2,Open Source Generic LoRaWAN Sensor NodeLSN50 v1.6.0 <--> DR-LWS-003;

LSN50 v1.7.0 <--> DR-LWS-005; --> Support since this version

LGT92,LoRaWAN GPS TrackerLGT92 v1.6.3 <--> DR-LWS-003;

LGT92 v1.6.4 <--> DR-LWS-005;--> Support since this version

LBT1,LoRaWAN BLE Indoor TrackerLBT1 v1.0 <--> DR-LWS-005;
RS485-LN,LoRaWAN RS485 Modbus ConverterRS485-LN v1.3 <--> DR-LWS-005;
LHT65,LoRaWAN Temperature & Humidity SensorLHT65 v1.7 <--> DR-LWS-003;

LHT65 v1.8.0 <--> DR-LWS-005;--> Support since this version

4. System Management Commands

4.1 Change Uplink Interval

Feature: Change LoRaWAN End Node Transmit Interval.

AT Command: AT+TDC

                                                                                   AT+TDC
Command ExampleFunctionResponse
AT+TDC=?Show current transmit Interval30000

OK

the interval is 30000ms = 30s

AT+TDC=60000Set Transmit IntervalOK

Set transmit interval to 60000ms = 60 seconds

Downlink Command: 0x01

Format: Command Code (0x01) followed by 3 bytes time value.

If the downlink payload=0100003C, it means set the END Node’s Transmit Interval to 0x00003C=60(S), while type code is 01.

  • Example 1: Downlink Payload: 0100001E // Set Transmit Interval (TDC) = 30 seconds
  • Example 2: Downlink Payload: 0100003C // Set Transmit Interval (TDC) = 60 seconds

4.2 Reboot End Node

Feature: Reboot End Node to perform a new OTAA or ABP Join.

AT Command: ATZ

                                                                         ATZ: Trig a reset of the MCU
Command ExampleFunctionResponse
)))
ATZReset MCU

Device reset and show booting info

LSN50 Device/LoRa ST Module

Image Version: XX

Frequency Band: XX

DevEui= XX XX XX XX XX XX XX XX

<followed by the Tx and Rx information>

Downlink Command: 0x04

Format: Command Code (0x04) followed by FF.

If the downlink payload=04FF, the end node will reboot.

4.3 Reset to factory Default

Feature: Reset the parameters to Factory Default, factory default value depends on the firmware settings, the OTAA and ABP keys will reserve after this command.

AT Command: AT+FDR

Reset to factory default
Command ExampleFunctionResponse
AT+FDRReset to factory defaultDevice reset to factory default parameters and show booting info
LSN50 Device/LoRa ST Module
Image Version: XX
Frequency Band: XX
DevEui= XX XX XX XX XX XX XX XX
Please set the parameters or reset Device to apply change

Downlink Command: 0x04

Format: Command Code (0x04) followed by FE.

If the downlink payload=04FE, Reset Parameters to Factory Default, Keys Reserve.

4.4 Show Firmware Version

Feature: Show firmware version. No downlink command yet.

AT Command: AT+VER

AT+VER: Image Version and Frequency Band
Command ExampleFunctionResponse
AT+VER=?Show Image version and Frequency Band 
1.3 EU868
OK

Downlink Command: 0x26 (Valid in 006 stack)

Downlink Format: 0x26

Device will reply with firmware version info, device info. frequency band info. detail please check device user manual. Total 5 bytes Example: If device is of firmware version 1.1.0 Upload: xx -- yy -- zz -- 110 total 5 bytes

xx: Software Type:

  • 0x00 01: LGT92 Version
  • 0x00 02: LBT1
  • 0x00 03: LSE01/LDDS75/LDDS20/LSPH01/LLMS01/LSNPK01

yy: Frequency Band:

  • 0x01: EU868
  • 0x02: US915
  • 0x03: IN865
  • 0x04: AU915
  • 0x05: KZ865
  • 0x06: RU864
  • 0x07: AS923
  • 0x08: AS923-1
  • 0x09: AS923-2
  • 0xa0: AS923-3

zz: Subband

firmware version: v1.1.0 --> 110

4.5 Show System Configure

Feature: Show All configure. No downlink command yet.

AT Command: AT+CFG

AT+CFG: Print all configurations
Command ExampleFunctionResponse
AT+CFGShow all configures 
AT+DEUI = XX XX XX XX XX XX XX XX
AT+DADDR=XXXXXXXX
……….
AT+RX2WTO=X
AT+CHS=868100000
OK

5. Keys, IDs and EUIs management

5.1 Application EUI

Feature: Get or Set the Application EUI.

AT Command: AT+APPEUI

AT+APPEUI
Command ExampleFunctionResponse
AT+APPEUI=?Get the Application EUI00 b3 d5 00 00 00 00 00

OK

AT+APPEUI=00 b3 d5 7e f0 00 4d 34Set the Application EUIOK

5.2 Application Key

Feature: Get or Set the Application Key.

AT Command: AT+APPKEY

AT+APPKEY
Command ExampleFunctionResponse
AT+APPKEY=?Get the Application Key00 35 55 55 22 23 55 53 43 24 23 42 34 35 35 35

OK

AT+APPKEY=00 35 55 55 22 23 55 53 43 24 23 42 34 35 35 35Set the Application Key.OK

5.3 Application Session Key

Feature: Get or Set the Application Session Key.

AT Command: AT+APPSKEY

AT+APPSKEY
Command ExampleFunctionResponse
AT+APPSKEY=?Get the Application Session Key00 7d dc 73 33 d3 eb 9e 14 38 d5 a4 3e 62 5b e2

OK

AT+APPSKEY=00 7d dc 73 33 d3 eb 9e 14 38 d5 a4 3e 62 5b e2Set the Application Session Key.(While Error in format, return AT_PARAM_ERROR)

OK

5.4 Device Address

Feature: Get or Set the Device Address.

AT Command: AT+DADDR

AT+DADDR
Command ExampleFunctionResponse
AT+DADDR=?Get the Application Session Key.(While Error in format, return AT_PARAM_ERROR)

A8 40 41 FF

OK

AT+DADDR=A8 40 41 FFSet the Application Session Key.OK

5.5 Device EUI

Feature: Get or Set the Device EUI.

AT Command: AT+DEUI

AT+DEUI
Command ExampleFunctionResponse
AT+DEUI=?Get the Device EUI.00 44 34 22 33 45 55 55

OK

AT+DEUI=A8 40 41 FF FF 12 34 56Set the Device EUI.(System will write new value to Device EUI,While Error in format, return AT_PARAM_ERROR)

OK

5.6 Network ID

Feature: Get or Set the Network ID.(You can enter this command change only after successful network connection)

AT Command: AT+NWKID

AT+NWKID
Command ExampleFunctionResponse
AT+NWKID=?Get the Network ID.a8 40 41 ff

OK

AT+NWKID=A8 40 41 FFSet the Network ID.OK

5.7 Network Session Key

Feature: Get or Set the Network Session Key

AT Command: AT+NWKSKEY

AT+NWKSKEY
Command ExampleFunctionResponse
AT+NWKSKEY=?Get the Network Session Key.00 4f 19 25 52 ce 97 09 d7 fa 84 71 db 51 02 92

OK

AT+NWKSKEY=A8 40 41 FF FF 12 34 56 00 01 02 04 05 06 06 07Set the Network Session Key.OK

6. Joining and sending date on LoRaWAN network

6.1 Confirm Mode

Feature: Get or Set the confirmation mode (0-1).

AT Command: AT+CFM

AT+CFM
Command ExampleFunctionResponse
AT+CFM=?Get the confirmation mode0

OK

AT+CFM=1Set the confirmation modeOK
AT+CFM=2Set the confirmation modeWhile Error in format, return AT_PARAM_ERROR

Downlink Command: 0x05

Format: Command Code (0x05) followed by 2 bytes mode value.

If the downlink payload=0501, it means set end node to use confirm mode, while type code is 05.

  • Example 1: Downlink Payload: 0501 // Set AT+CFM=1
  • Example 2: Downlink Payload: 0500 // Set AT+CFM=0

6.2 Confirm Status

Feature: Get confirmation status of the last AT+SEND (0-1).

AT Command: AT+CFS

AT+CFS
Command ExampleFunctionResponse
AT+CFS=?Get confirmation status0

OK

6.3 Join LoRa® Network

Feature: Join network.

AT Command: AT+JOIN

AT+JOIN
Command ExampleFunctionResponse
AT+JOIN ?Get imformation.AT+JOIN: Join network

OK

While Error in format, return AT_BUSY_ERROR

6.4 LoRa® Network Join Mode

Feature: Get or Set the Network Join Mode. (0: ABP, 1: OTAA).

AT Command: AT+NJM

AT+NJM
Command ExampleFunctionResponse
AT+NJM=?Get the Network Join Mode1

OK

AT+NJM=0Set the Network Join ModeOK
AT+NJM=2Set the Network Join ModeWhile Error in format, return AT_PARAM_ERROR

Downlink Command: 0x20

Format: Command Code (0x20) followed by 1 bytes mode value.

If the downlink payload=2000, it means set the Network Join Mode, while type code is 20.

  • Example 1: Downlink Payload: 2000 // Set AT+NJM=O
  • Example 2: Downlink Payload: 2001 // Set AT+NJM=1

6.5 LoRa® Network Join Status

Feature: LoRa® Network Join Status.

AT Command: AT+NJS

AT+NJS
Command ExampleFunctionResponse
AT+NJS=?Get the join status.0

OK

6.6 Print Last Received Data in Raw Format

Feature: Print Last Received Data in Raw Format<port:data>.

AT Command: AT+RECV

AT+RECV
Command ExampleFunctionResponse
AT+RECV=?print last received data in raw format.0:

OK

6.7 Print Last Received Data in Binary Format

Feature: Print Last Received Data in Binary Format<port:data>.

AT Command: AT+RECVB

AT+RECVB
Command ExampleFunctionResponse
AT+RECVB=?print last received data in binary format (with hexadecimal values).2: 0010

OK

6.8 Send Text Data

Feature: Send Text Data<port:data>.

AT Command: AT+SEND

AT+SEND
Command ExampleFunctionResponse
AT+SEND=12:hello worldSend text data along with the application port.OK

While Error in format, return

AT_BUSY_ERROR/AT_BUSY_ERROR/AT_NO_NETWORK_JOINED

 

6.9 Send Hexadecimal Data

Feature: Send hexadecimal data along with the application port.

AT Command: AT+SENDB

AT+SENDB
Command ExampleFunctionResponse
AT+SENDB=12:abcdef0123456789Send hexadecimal data along with the application port.OK
AT+SENDB=abcdef0123456789Send hexadecimal data along with the application port.While Error in format, return

AT_PARAM_ERROR AT_BUSY_ERROR/AT_NO_NETWORK_JOINED

 

7. LoRaWAN network management

7.1 Adaptive Data Rate

Feature: Get or Set the Adaptive Data Rate setting. (0: off, 1: on).

AT Command: AT+ADR

AT+ADR
Command ExampleFunctionResponse
AT+ADR=?Get the Adaptive Data Rate setting.1

OK

AT+ADR=0Set the Adaptive Data Rate setting.OK
AT+ADR=2Set the Adaptive Data Rate setting.While Error in format, return

AT_PARAM_ERROR

Downlink Command: 0x22

If the downlink payload=2201, it means setting the adaptive data rate to 1, while type code is 22.

  • Example 1: Downlink Payload: 2201 // Set AT+ADR=1.
  • Example 2: Downlink Payload: 2200FFFF // Set AT+ADR=0.

7.2 LoRa® Class

Feature: Get or Set the Device Class(Currently only support class A, class C).

AT Command:AT+CLASS

AT+CLASS
Command ExampleFunctionResponse
AT+CLASS=?Get the Device Class.A

OK

AT+CLASS=CSet the Device Class.OK

 

7.3 Duty Cycle Setting

Feature: Get or Set the ETSI Duty Cycle setting - 0=disable, 1=enable - Only for testing.

AT Command:AT+DCS

AT+DCS
Command ExampleFunctionResponse
AT+DCS=?Get the ETSI Duty Cycle setting.1

OK

AT+DCS=1Set the ETSI Duty Cycle setting.OK

 

7.4 Data Rate

Feature: Get or Set the Data Rate. (0-7 corresponding to DR_X) . Note: while set Data Rate, please use set Adptive Data Rate, ADR=0 first. otherwise device will response to server's ADR command and change the DR to the setting from server

AT Command: AT+DR

AT+DR
Command ExampleFunctionResponse
AT+DR=?Get the Data Rate.5

OK

AT+DR=2Set the Data Rate.OK

 

Downlink Command: 0x2200aaFF

If the downlink payload=220001FF, it means setting the data rate to 1, while type code is 22 00 aa FF.

  • Example 1: Downlink Payload: 220001FF // Set AT+DR=1.
  • Example 2: Downlink Payload: 220000FF // Set AT+DR=0.

Feature: Get or Set the Frame Counter Downlink.

AT Command:AT+FCD

AT+FCD
Command ExampleFunctionResponse
AT+FCD=?Get the Frame Counter Downlink.0

OK

AT+FCD=10Set the Frame Counter Downlink.(System will write new value to FCD)

OK

 

Feature: Get or Set the Frame Counter Uplink.

AT Command:AT+FCU

AT+FCU
Command ExampleFunctionResponse
AT+FCU=?Get the Frame Counter Uplink.0

OK

AT+FCU=10Set the Frame Counter Uplink.OK

 

7.7 Join Accept Delay1

Feature: Get or Set the Join Accept Delay between the end of the Tx and the Join Rx Window 1 in ms.

AT Command:AT+JN1DL

AT+JN1DL
Command ExampleFunctionResponse
AT+JN1DL=?Get the Join Accept Delay.5000

OK

AT+JN1DL=10000Set the Join Accept Delay.OK

 

7.8 Join Accept Delay2

Feature: Get or Set the Join Accept Delay between the end of the Tx and the Join Rx Window 2 in ms.

AT Command:AT+JN2DL

AT+JN2DL
Command ExampleFunctionResponse
AT+JN2DL=?Get the Join Accept Delay.6000

OK

AT+JN2DL=20000Set the Join Accept Delay.OK

 

7.9 Public Network Mode

Feature: Get or Set the public network mode. (0: off, 1: on)

AT Command:AT+PNM

AT+PNM
Command ExampleFunctionResponse
AT+PNM=?Get the public network mode.1

OK

AT+PNM=1Set the public network mode.(System will write new value to PNM)

OK

 

7.10 Receive Delay1

Feature: Get or Set the delay between the end of the Tx and the Rx Window 1 in ms

AT Command:AT+RX1DL

AT+RX1DL
Command ExampleFunctionResponse
AT+RX1DL=?Get the delay.1000

OK

AT+RX1DL=1500Set the delay.OK

 

7.11Receive Delay2

Feature: Get or Set the delay between the end of the Tx and the Rx Window 2 in ms

AT Command:AT+RX2DL

AT+RX2DL
Command ExampleFunctionResponse
AT+RX2DL=?Get the delay.2000

OK

AT+RX2DL=2500Set the delay.OK

 

7.12 Rx2 Window Data Rate

Feature: Get or Set the Rx2 window data rate (0-7 corresponding to DR_X)

AT Command:AT+RX2DR

AT+RX2DR
Command ExampleFunctionResponse
AT+RX2DR=?Get the Rx2 window data rate.2

OK

AT+RX2DR=6Set the Rx2 window data rate.OK

 

7.13 Rx2 Window Frequency

Feature: Get or Set the Rx2 window frequency

AT Command:AT+RX2FQ

AT+RX2FQ
Command ExampleFunctionResponse
AT+RX2FQ=?Get the Rx2 window frequency.434665000

OK

AT+RX2FQ=434665000Set the Rx2 window frequency.OK

 

7.14 Transmit Power

Feature: Get or Set the Transmit Power(0-5, MAX:0, MIN:5, according to LoRaWAN Spec, or 40=10dB, 41 = 11dB, …, 50 = 20dB which is out of LoRaWAN spec. )

AT Command:AT+TXP

AT+TXP
Command ExampleFunctionResponse
AT+TXP=?Get the Transmit Power.0

OK

AT+TXP=1Set the Transmit Power.OK

 

Downlink Payload. The 4th byte of 0x22 downlink.

If the downlink payload=22000100, it means setting the TXP to 0.

  • Example 1: Downlink Payload: 22000102 // Set AT+TXP=2.
  • Example 2: Downlink Payload: 220000FF // Set AT+TXP=0.

7.15 RSSI of the Last Received Packet

Feature: Get or Set the Rx2 window frequency

AT Command:AT+RSSI

AT+RSSI
Command ExampleFunctionResponse
AT+RSSI=?Get the RSSI of the last received packet.0

OK

7.16 SNR of the Last Received Packet

Feature: Get the SNR of the last received packet

AT Command:AT+SNR

AT+SNR
Command ExampleFunctionResponse
AT+SNR=?Get the RSSI of the last received packet.0

OK

7.17 Application Port

Feature: Get or set the application port.

AT Command: AT+PORT

AT+PORT
Command ExampleFunctionResponse
AT+PORT=?Get the application port21

OK

AT+PORT=21Set the application portOK

Downlink Command: 0x23

Format: Command Code (0x23) followed by 1 bytes port value.

If the downlink payload=2301, it means set the application port to 1, while type code is 23.

  • Example 1: Downlink Payload: 2301 // set the application port to 1
  • Example 2: Downlink Payload: 2305 // set the application port to 5

7.18 Single Channel Mode

Feature:Get or Set Frequency (Unit: Hz) for Single Channel Mode.

AT Command: AT+CHS

AT+CHS
Command ExampleFunctionResponse
AT+CHS=?Get Frequency for Single Channel Mode0

OK

AT+CHS=868100000Set Frequency for Single Channel ModeOK

7.19 Eight Channel Mode

Feature: Get or Set eight channels mode,Only for US915,AU915,CN470.

AT Command: AT+CHE

AT+CHE
Command ExampleFunctionResponse
AT+CHE=?Get eight channels mode1

902.3 902.5 902.7 902.9 903.1 903.3 903.5 903.7

OK

AT+CHE=1Set eight channels modeOK

Downlink Command: 0x24

Format: Command Code (0x24) followed by 1 bytes channel value.

If the downlink payload=2401, it means set channel mode to 1, while type code is 24.

  • Example 1: Downlink Payload: 2401 // set channel mode to 1
  • Example 2: Downlink Payload: 2405 // set channel mode to 5

7.20 Get or Set RXwindows1 timeout

Feature:Get or Set the number of symbols to detect and timeout from RXwindow1(0 to 255).

AT Command: AT+RX1WTO

AT+ RX1WTO
Command ExampleFunctionResponse
AT+RX1WTO=?Get RXwindows1 timeout14

OK

AT+RX1WTO=60Set RXwindows1 timeoutOK

AT+RX1TWO is theRxSingle timeout value of receive window 1. If it is not set, then the queriedvalue is the default value. If it is set, then the queried value is the setvalue. AT+RX2TWO is thesame as above. The definitionof RxSingle timeout is as described in the following paragraph.

RX1WTO.JPG

Increasing thisvalue is equal to extending the time that the receiving window is opened, butthe corresponding power consumption will also increase. Properly increasingthis value can increase the success rate of the downlink.

7.21 Get or Set RXwindows2 timeout

Feature:Get or Set the number of symbols to detect and timeout from RXwindow2(0 to 255).

AT Command: AT+RX2WTO

AT+ RX2WTO
Command ExampleFunctionResponse
AT+RX2WTO=?Get RXwindows2 timeout7

OK

AT+RX2WTO=20Set RXwindows2 timeoutOK

7.22 Setting up uplinkdwelltime (as923, au915)

Feature: Get or Set uplinkdwelltime

AT Command: AT+DWELLT

AT+DWELLT
Command ExampleFunctionResponse
AT+DWELLT=?Get uplinkdwelltime1

OK

AT+DWELLT=0Set uplinkdwelltimeOK

Downlink Command: 0x25

Format: Command Code (0x25) followed by 1 bytes state value.

If the downlink payload=2501, it means set uplinkdwelltime to 1, while type code is 25.

  • Example 1: Downlink Payload: 2501 // set uplinkdwelltime to 1
  • Example 2: Downlink Payload: 2500 // set uplinkdwelltime to 0

7.23 Set Packet Receiving Response Level

Feature: Get or Set packet receiving response level. This feature is used to set compatible with different LoRaWAN servers. If RPL doesn;t match , user will see strange message in the server portal.

RPL value:

  • AT+RPL=0: Device won't immediately reply any downlink commands from platform.
  • AT+RPL=1: Device will immediately reply message to Unconfirmed Data Down. Payload is 0x00.
  • AT+RPL=2: Device will immediately reply message to Confirmed Data Down. Payload is 0x00 and requied response header for this command.
  • AT+RPL=3: Device will immediately reply message to MAC Command. Payload is 0x00 and requied response header for this command.
  • AT+RPL=4: Device will immediately reply message to Confirmed Data Down & MAC Command. Payload is 0x00 and requied response header for these two commands.

Case Analyes:

  • For Class A devices, AT+RPL=0 is ok. that is defaut settings in software.
  • For Class C devices used in ChirpStack, need to set AT+RPL=4 because Chirpstack require immedietely reply message to MAC Command.
  • For Class C devices used in TTI, need to set AT+RPL=4 because TTI require immediately reply message to Confirmed Data Down & MAC Command.

AT Command: AT+RPL

AT+RPL
Command ExampleFunctionResponse
AT+RPL=?Get packet receiving response level1

OK

AT+RPL=0Set packet receiving response levelOK

Downlink Command: 0x21

Format: Command Code (0x21) followed by 1 bytes level value.

If the downlink payload=2101, it means set packet receiving response level to 1, while type code is 21.

  • Example 1: Downlink Payload: 2101 // set packet receiving response level to 1
  • Example 2: Downlink Payload: 2102 // set packet receiving response level to 2

8. AT Commands Combination

8.1 Set a fix RX2DR for downlink window

  • AT+ADR=0 --> Disable ADR first
  • AT+RX2DR=xxxx --> Set xxxx to your wanted DataRate

8.2 Use Downlink Command to set a fix uplink DR

Downlink Command: 0x22000500

Same as:

Tags:
    
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0