Arduino library for communication to LoRa module via UART
General convention used in commands of LoRa network
- Every command and response through UART should be in String format.
- Every command string should end with ('\r\n').
- Every numerical value in command string should be Hexadecimal number in form of single Byte.
- Every terms in command string are separated by ','. If any data consist of more than single byte then use ',' as separator.
START, | Read/Write, | AT Command, | Value | <CR-LF> |
---|---|---|---|---|
"$CMD" | 1 Byte (00 read and 01 write) |
1 Byte | 1 or more Byte separated by ',' | "\r\n" |
Response API Format:
START, | AT Command, | Status, | Value | <CR-LF> |
---|---|---|---|---|
"$RES" | 1 Byte | 1 Byte 00 –success 01-invalid parameter 02-AT command error |
[Optional] | "\r\n" |
List of Request Api:
API COMMAND | DESCRIPTION | PARAMETER | DEFAULTS |
---|---|---|---|
$CMD,00,00<CR-LF> | Restore defaults | _ | _ |
$CMD,00,01<CR-LF> | Initialize LoraWan | _ | _ |
$CMD,00,02<CR-LF> | Deactivate LoRAWan | _ | _ |
$CMD,00,03<CR-LF> | Activate LoraWan | _ | _ |
$CMD,00,04<CR-LF> (to read) $CMD,01,04,<val><CR-LF> (to change) |
Baud Rate | 00-04 | 01 00(4800), 01(9600), 02(19200), 03(57600), 04(115200) |
$CMD,00,05<CR-LF> (to read) $CMD,01,05,<val><CR-LF> (to change) |
Device EUI | 8 Bytes | 01,02,03,04,05,06,07,08 |
$CMD,00,06<CR-LF> (to read) $CMD,01,06,<val><CR-LF> (to change) |
Application EUI | 8 Bytes | 0F,0E,0D,0C,0B,0A,09,08 |
$CMD,00,07<CR-LF> | Application KEY | 16 Bytes | 01,11,21,31,41,51,61,71,81,91,A1,B1,C1,D1,E1,F1 |
$CMD,00,08<CR-LF> | Network Key | 16 Bytes | 00,10,20,30,40,50,60,70,80,90,A0,B0,C0,D0,E0,F0 |
$CMD,00,09<CR-LF> | Device Address | 4 Bytes | 01,02,03,04 |
$CMD,00,0A<CR-LF> | Network Connection Type | 00-ABP, 01-OTAA |
00 |
$CMD,00,0B<CR-LF> | Network Id | 4 Bytes | 00,00,00,01 |
$CMD,00,0C<CR-LF> | ADR ON/OFF | 00 ON 01 OFF |
01 |
$CMD,00,0D<CR-LF> | Uplink Ack | ON/OFF 00 ON 01 OFF |
00 |
$CMD,00,0E<CR-LF> | Data Confirmation Retries | 1 Byte | 05 |
$CMD,00,0F<CR-LF> | Default Datarate | 00 to 05 | 00 |
$CMD,00,10<CR-LF> | Power Saving Mode | 00 ON 01 OFF |
01 |
$CMD,00,11<CR-LF> | Class Selection A/C | 00 C 01 A |
00 |
$CMD,00,12<CR-LF> | Save all configurations to EEPROM | _ | _ |
$CMD,00,13<CR-LF> | Retrieve all configurations from EEPROM | _ | _ |
$CMD,00,FF<CR-LF> | Module test command | _ | _ |
Uplink API Format:
Start, | Port Number, | Data Length, | Data, | <CR-LF> | |
---|---|---|---|---|---|
For Uplink | "$UP" | 1 Byte | 1 Byte | 1 or More Bytes separated by ',' | "\r\n" |
Response from Device | "$UP" | 00 | 00-success 01-failure |
Downlink API Format:
Start, | Port Number, | Data Length, | Data, | <CR-LF> |
---|---|---|---|---|
"$DOWN" | 1 Byte | 1 Byte | 1 or More Bytes separated by ',' | "\r\n" |