44
V3.0.0.3 1 Get Start with RAK5205 Wistrio 1. Where is the latest firmware file? If you want to get a pre-compiled firmware, you can find the latest firmware on RAK website: https://downloads.rakwireless.com/en/LoRa/WisTrio-LoRa-RAK5205/Firmware/ 2. How to burn the bootloader into RAK5205? Usually, you needn’t to burn the bootloader because there will be a bootloader in RAK5205 from V3.0.0.0 firmware on, so if the firmware of your RAK5205 is V3.0.0.0 or a newer one, just jump this section. But if you are using an old firmware of RAK811, you need to burn the bootloader into RAK5205 firstly as follow: Firstly, please install the “STM32CubeProgrammer” tool on your Windows PC. You can download it from ST official website: https://www.st.com/content/st_com/en/products/development-tools/software-develop ment-tools/stm32-software-development-tools/stm32-programmers/stm32cubeprog.h tml#overview or from RAK website: https://downloads.rakwireless.com/en/LoRa/RAK811/Tools/SetupSTM32CubeProgra mmer-2.1.0.rar Secondly, jump the “BOOT” pin and “VDD” pin for boot mode as the following picture shows:

GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

1

Get Start with RAK5205 Wistrio

1. Where is the latest firmware file?If you want to get a pre-compiled firmware, you can find the latest firmware on RAKwebsite:

https://downloads.rakwireless.com/en/LoRa/WisTrio-LoRa-RAK5205/Firmware/

2. How to burn the bootloader into RAK5205?Usually, you needn’t to burn the bootloader because there will be a bootloader inRAK5205 from V3.0.0.0 firmware on, so if the firmware of your RAK5205 isV3.0.0.0 or a newer one, just jump this section.

But if you are using an old firmware of RAK811, you need to burn the bootloader intoRAK5205 firstly as follow:

Firstly, please install the “STM32CubeProgrammer” tool on your Windows PC. Youcan download it from ST official website:

https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stm32cubeprog.html#overview

or from RAK website:

https://downloads.rakwireless.com/en/LoRa/RAK811/Tools/SetupSTM32CubeProgrammer-2.1.0.rar

Secondly, jump the “BOOT” pin and “VDD” pin for boot mode as the following pictureshows:

Page 2: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

2

Connect RAK5205 with your PC’s USB interface as follow:

Page 3: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

3

Press the RST button on RAK5205:

Open the “STM32CubeProgrammer” tool, and select UART type, then configure thePort, Baudrate, and Pairty as the following picture shows:

Note: It is COM5 on my computer, and it may be another COM port on your computer.

Then press “Connect” button at the top right corner. If there are some errors in the Logbox or it can’t connect, please close the STM32CubeProgrammer and reset RAK5205,then open the STM32CubeProgrammer and connect again.

Page 4: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

4

The correct Log you should see is the information like the following picture shows:

Now, let’s start to burn a firmware into RAK5205.

At first, erase all data on RAK5205 according the following picture shows, it may takeseveral seconds:

Page 5: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

5

Press “Open file” and select the bootloader file in the pop-up window as follow:

Press the “Download” button to start the burning process:

Page 6: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

6

OK, you have burned the bootloader into RAK5205 successfully!

Page 7: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

7

“Disconnect” and close the “STM32CubeProgrammer” tool.

Now, power down and remove the connection of “BOOT” pin and the “VDD” pin asfollow:

Then, connect RAK5205 with your PC’s USB interface again.

If you have opened the serial port tool, you can see some content like this:

Page 8: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

8

It means that you have burned the bootloader into RAK5205 successfully.Note: Please download this serial port tool from RAK website:

https://downloads.rakwireless.com/en/LoRa/RAK811/Tools/RAK_SERIAL_PORT_TOOL_V1.2.1.zip

OK, you should continue to burn the firmware into RAK5205 now!

3. How to burn the firmware into RAK5205?If the current version of the RAK5205’s firmware is newer than V3.0.0.0 or you havejust burned the bootloader into RAK5205 according to the section 2, you just need toburn the firmware according to the following steps now:

Firstly, let the RAK5205 work in boot mode. If you have just burned the bootloader byyourself according to the section 2, it works in boot mode now. If the current version ofthe RAK5205’s firmware is newer than V3.0.0.0, you need to set an AT command<at+set_config=device:boot> to let it work in boot mode.

Page 9: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

9

Secondly, close serial port tool and download the RAK Upgrade Tool from RAKwebsite:

https://www.rakwireless.com/en/download/LoRa/RAK612-LoRaButton#Tools

Open this tool:

Click “Choose File” button to choose a correct firmware file:

Page 10: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

10

“Start” to upgrade, it may take one minute, if it can’t start, please push the reset buttonof RAK5205 then try again:

Page 11: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

11

Now, close the upgrade tool and open a serial port tool.

We recommend you to use RAK serial port tool, because there are some ready ATcommands in this tool and this will be very useful for you. You can get it from RAKwebsite and use it freely.

http://docs.rakwireless.com/en/LoRa/RAK811/Tools/RAK_SERIAL_PORT_TOOL_V1.2.1.zip

Choose the correct COM port and baud rate is 115200. Then press the RST button onRAK5205, you’ll see the following log on serial port tool:

It means that you have burned the firmware successfully!

Page 12: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

12

4. How to configure RAK5205?You can configure RAK5205 by sending AT commands into it from RAK serial porttool running on your PC.

The following list shows the AT commands for RAK5205:

AT Command Description

at+version Get the current firmware version number.

at+get_config=device:status Get all information about the device’shardware components and their current

status.

at+set_config=device:restart After set, the device will restart.

at+set_config=device:boot Let the device work in boot mode.

at+run Stop boot mode and run as normal. It isvalid when the device works in boot mode.

at+set_config=device:gps:X Turn on or turn off GPS.

X definition: 0: close, 1: open, 2: sleep, 3:standby

at+set_config=device:gps_timeout:X Set the timeout of searching GPS satellite.

X definition: the time in second.

at+set_config=device:sleep:X After setting, the device will go to sleepmode or wake up immediately.

X definition: 0: wake up, 1: sleep

at+join Start to join LoRa network.

at+send=lora:X:YYY Send a customized data.

X definition: LoRa port

YYY definition: the data which you want tosend. The limited length is 50 Bytes, and the

data must be in HEX format.

at+set_config=lora:work_mode:X Set the work mode for LoRa.

X definition: 0: LoRaWAN, 1: LoRaP2P, 2:Test Mode.

Page 13: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

13

at+set_config=lora:join_mode:X Set the join mode for LoRaWAN.

X definition: 0: OTAA, 1: ABP

at+set_config=lora:class:X Set the class for LoRa.

X definition: 0: Class A, 1: Class B, 2: ClassC

at+set_config=lora:region:XXX Set the region for LoRa.

XXX define: one of the following items:

EU868 EU433, CN470, IN865, EU868,AU915, US915, KR920, AS923.

at+set_config=lora:confirm:X Set the type of messages which will be sentout through LoRa.

X definition: 0: unconfirm, 1: confirm

at+set_config=lora:dev_eui:XXXX Set the device EUI for OTAA.

XXXX definition: the device EUI.

at+set_config=lora:app_eui:XXXX Set the application EUI for OTAA.

XXXX definition: the application EUI.

at+set_config=lora:app_key:XXXX Set the application key for OTAA.

XXXX definition: the application key.

at+set_config=lora:dev_addr:XXXX Set the device address for ABP.

XXXX definition: the device address.

at+set_config=lora:apps_key:XXXX Set the application session key for ABP.XXXX definition: the application session

key.

at+set_config=lora:nwks_key:XXXX Set the network session key for ABP.

XXXX definition: the network session key.

at+set_config=lora:ch_mask:X:Y Set a certain channel on or off.

X definition: the channel number, and youcan check which channel can be set before

you set it.

Y definition: 0: off, 1: on

Page 14: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

14

at+set_config=lora:send_interval:X:Y

Set the interval of sending data.

X definition: open or close the intervalmechanism of sending data. If X is set to 0,

it means the device will not send dataautomatically. If X is set to 1, it means thedevice will send data every Y second.

Y definition: the interval time, the unit issecond. This parameter is only valid when X

is set to 1.

at+set_config=lora:adr:X Open or close the ADR function of LoRaNode.

X definition: 0: Close ADR; 1: Open ADR.

at+set_config=lora:dr:X Set the DR of LoRa Node.

X definition: the number of DR. Generally,the value of X can be 0~5. More details,

please check the LoRaWAN 1.0.2specification.

at+get_config=lora:status It will return all of the current information ofLoRa, except LoRa channel.

at+get_config=lora:channel It will return the state of all LoRa channels,then you can see which channel is closedand which channel is open very clearly.

at+set_config=lorap2p:XXX:Y:Z:A:B:C

Set the parameters for LoRa P2P mode.This AT command is valid when the work

mode is ·LoRaP2P.

XXX definition: Frequency in Hz.

Y definition: Spreading factor, [6, 7, 8, 9, 10,11, 12].

Z definition: Bandwidth,

0: 125 kHz,

1: 250 kHz,

2: 500kHz.

A definition: Coding Rate,

Page 15: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

15

1: 4/5,

2: 4/6,

3: 4/7,

4: 4/8.

B definition: Preamble Length, 5~65535.

C definition: Power in dbm, 5~20.

at+send=lorap2p:XXX Send data through LoRaP2P. This ATcommand is valid when it works in LoRaP2P

mode.

XXX definition: the data in HEX.

More information, please have a look at the next section <How to Connect withTTN?>.

5. How to connect with TTN?In this section, we’ll do some practice to show how to connect RAK5205 with TTN.

Firstly, connect RAK5205 with your PC and open the serial port tool on your PC.

Open the serial port by click the following button:

In this document, I assume that you have connected a LoRa gateway with TTNcorrectly. If not, please have a look at the document of RAK LoRa gateway.

Page 16: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

16

OK, let’s continue. Open the link https://www.thethingsnetwork.org/ and login, thenopen the “Console” page from the right corner at the top:

Press “APPLICATIONS”:

“add application”:

Fill in the correct contents.

Please note that the content you fill in “Application ID” item should be in low case, andit must be the unique ID on TTN network.

Page 17: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

17

Then press the “Add application” button at the bottom of this page, and you can seethe following page:

At the middle of this page, you can find the box named “DEVICES”:

Just “register device”:

Page 18: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

18

You can click the icon and “Device EUI” will be generated automatically in the nextstep:

Then press the “Register” button at the bottom of this page to finish.

Page 19: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

19

5.1 Join in OTAA modeAs you see in the above page, the default activation method is OTAA.

These three parameters will be used on RAK5205:

OK! Now, let’s join in OTAA mode and EU868 frequency for example!

The default LoRa work mode is LoRaWAN 1.0.2, the default LoRa join mode is OTAA,and the default LoRa class is Class A.

You can also set the join mode to OTAA as follow:

Page 20: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

20

Set the LoRa class to Class A:

Set the frequency/region to EU868:

Page 21: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

21

Set the Device EUI:

Set the Application EUI:

Page 22: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

22

Set the Application Key:

Join in OTAA mode:

Page 23: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

23

Join successfully!

You can see that, once join successfully, RAK5205 will send sensor’s data in aninterval loop automatically by default!

You can see these data on TTN website as follow:

That’s all about OTAA mode.

5.2 Join in ABP modeFirst you need to switch the activation method is ABP.

Page 24: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

24

These three parameters will be used on RAK5205:

Then you can set these 3 parameters into RAK5205:

Page 25: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

25

Page 26: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

26

and switch the join mode to ABP:

OK, join in ABP mode:

Note: Actually, it is no need to join in ABP mode. But you still need to set this ATcommand to valid the parameters which you just set for ABP mode.

As you see, RAK5205 has sent sensor’s data to TTN in ABP mode automatically bydefault, and TTN has received successfully:

Page 27: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

27

Great! That’s all about ABP!

6. How to connect with LoRaServer?The LoRaServer is an open source project which you can find inhttps://www.loraserver.io/.

You can use RAK5205 to connect with LoRaServer according to the following steps:

In this document, I assume that you are using RAK LoRa gateway and its built-inLoRaServer or RAK cloud testing LoRaServer. I also assume that you haveconfigured a LoRa gateway with the LoRaServer successfully. If not, please have alook at RAK’s documents for More details about RAK LoRa gateway and RAK cloudtesting LoRaServer:

https://downloads.rakwireless.com/en/LoRa/

Also, RAK supply a free cloud LoRaServer for you to test, just go to RAK forum tosubmit an application:

https://forum.rakwireless.com/t/rak-free-cloud-loraserver-for-testing/344/45

OK! Let’s get start!

Open the web page of the LoRaServer which you want to connect with and login.

Page 28: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

28

By default, there is already one or more items in this page, you can use it or create anew item. Now, let’s create a new item by click the “CREATE” button, and fill in them.

“CREATE APPLICATION”.

Page 29: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

29

Click the new item name “RAK811”:

Add a LoRa node device into LoRaServer by clicking the “CREATE” button:

Page 30: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

30

Fill in them. You can generate a Device EUI automatically by click the following icon,or you can write a correct Device EUI in the edit box.

Note: If you want to join in OTAA mode, you should select “DeviceProfile_OTAA” inthe “Device-profile” item. If you want to join in ABP mode and CN470 frequency, youshould select “DeviceProfile_ABP_CN470” in the “Device-profile” item. If you want tojoin in ABP mode and other frequencies except AS923 and CN470, you should select“DeviceProfile_ABP” in the “Device-profile” item. What about AS923 in ABP mode?Sorry! LoRaServer can not support it now.

6.1 Join in OTAA modeIf you select “DeviceProfile_OTAA”, it means you want to join LoRaServer in OTAAmode.

Page 31: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

31

“CREATE DEVICE”. Then generate the application key in this page. You can write itby yourself or generate it automatically by clicking the following icon:

“SET DEVICE-KEYS”. That’s OK! You’ve complete the configuration on LoRaServer.

As you see, the Device EUI which will be set into RAK7204 as “dev_eui” is this one:

The Application Key which will be set into RAK7204 as “app_key” is this one:

Page 32: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

32

The Application EUI which will be set into RAK7204 as “app_eui” is useless forLoRaServer, and you can set it to any value with a correct format, even if you can seta value as same as the dev_eui.

Next, let’s configure RAK7204 by using AT command.

Connect your RAK7204 with a PC, power on it and open RAK Serial Port Tool on yourPC.

The default LoRa work mode is LoRaWAN 1.0.2, and the default join mode is OTAA.

If the join mode is not OTAA now, just set the LoRa join mode to OTAA as follow:

Page 33: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

33

Set the LoRa class to Class A:

Set the frequency/region to EU868:

Page 34: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

34

Set “dev_eui”:

Set “app_eui”:

Page 35: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

35

Set “app_key”:

Start to join:

Page 36: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

36

Great! You can see that RAK5205 has joined succeessfully, and start to sendsensor’s data automatically by default.

You can see the data on LoRaServer web page:

OK, that’s all about “Join in OTAA mode” with LoRaServer.

6.2 Join in ABP modeIf you select “DeviceProfile_ABP” or “DeviceProfile_ABP_CN470”, it means you wantto join LoRaServer in OTAA mode.

Page 37: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

37

Then you can see that there are some parameters for ABP in the “ACTIVATION” item:

Next, let’s use these parameters to set RAK7204 by using AT command.

Set LoRa join mode to ABP:

Page 38: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

38

Set “dev_addr”:

Set “nwks_key”:

Page 39: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

39

Set “apps_key”:

Start to join:

Page 40: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

40

Note: Actually, it is no need to join in ABP mode. But you still need to set this ATcommand to valid the parameters which you just set for ABP mode.

It will send sensor’s data automatically by default.

You can see the data which is just sent from RAK5205 on LoRaServer web page:

That’s all about “Join in ABP mode” with LoRaServer.

7. Other points7.1 LoRaP2P modeThe usage of RAK5205 LoRaP2P mode is same with RAK811, so I just extract thefollowing contents from RAK811 document:

“In this document, i’ll show you how to use LoRaP2P mode on EU868 for example, other frequency is similar.

Page 41: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

41

First, find two RAK811 WisNode which can work on EU868 frequency and make sure their firmware version isn’t less than

V3.0.0.1.

Second, connect these two RAK811 WisNode with PC through UART, and open two serial port tool on PC.

Now, configure them to both work in LoRaP2P mode as follow:

Then configure LoRaP2P parameters for both of them as follow for example:

OK! Try to send a message from WisNode 2 (the right one) to WisNode 1 (the left one):

Page 42: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

42

Successfully!

Send more messages:

Successfully too!

Similarly, you can send message from WisNode 1 to WisNode 2 surely. Just try it freely.

Great! We’ve done it, and that’s all about how to use LoRaP2P on RAK811 WisNode.”

You can use RAK5205 LoRaP2P mode according to it.

7.2 ADR and DRYou can open the ADR feature of RAK5205 by using the following AT command:

Page 43: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

43

at+set_config=lora:adr:1

or you can close the ADR feature of RAK5205 by using this AT command:

at+set_config=lora:adr:0

There is also an AT command which is used to set the DataRate(DR):

at+set_config=lora:dr:X Set the DR of LoRa Node.

X definition: the number of DR. Generally, the value of Xcan be 0~5. More details, please check the LoRaWAN1.0.2 specification.

For example, if you want to set the current DR to DR0, you just do as follow:

at+set_config=lora:dr:0

7.3 Sleep mode and wake upThere are two ways to let RAK5205 work in sleep mode:

The first way is to set the following AT command:

at+set_config=device:sleep:0

The second way is to let RAK5205 work in a sending interval loop. In this case,RAK5205 will send a packet then go to sleep automatically, after some interval time,RAK5205 will wake up, send a packet then go to sleep automatically……, etc. Bydefault, RAK5205 will work in this loop once it joins successfully.

Please notice that RAK5205 will search GPS satellite firstly every time when it wakesup, and it may take almost 30 seconds. If you don’t want to wait for so long time, thereare two ways to set it:

1) Turn off GPS by using the following AT command:

at+set_config=device:gps:X Turn on or turn off GPS.

X definition: 0: close, 1: open, 2:sleep, 3: standby

2) Set the timeout of searching GPS satellite by using the following AT command:

at+set_config=device:gps_timeout:X Set the timeout of searching GPSsatellite.

X definition: the time in second.

Page 44: GetStartwithRAK5205WistrioŠ‚点/WisTrio...V3.0.0.3 13 at+set_config=lora:join_mode:X SetthejoinmodeforLoRaWAN. Xdefinition:0:OTAA,1:ABP at+set_config=lora:class:X SettheclassforLoRa

V3.0.0.3

44

Author Date Version

Fomi 2019.7.25 V3.0.0.3

About RAKwireless:

RAKwireless is the pioneer in providing innovative and diverse cellular and LoRaconnectivity solutions for IoT edge devices. It's easy and modular design can be used indifferent IoT applications and accelerate time-to-market.For more information, please visit RAKwireless website at www.rakwireless.com.