RAK811 Module Quick Start Guide
This guide covers the following topics:
- The Things Stack (TTN V3) OTAA Guide
- RAK811 OTAA AT Commands for The Things Stack
- The Things Stack (TTN V3) ABP Guide
- RAK811 ABP AT Commands for The Things Stack
- Chirpstack OTAA Guide
- RAK811 OTAA AT Commands for Chirpstack
- Chirpstack ABP Guide
- RAK811 ABP AT Commands for Chirpstack
- LoRa P2P Guide
- Updating RAK811 FW Procedure
Prerequisites
What do you need?
Before going through the step in the installation guide of the RAK811 WisDuo LPWAN Module, make sure to prepare the necessary items listed below:
Hardware Tools
- RAK811 WisDuo LPWAN Module
- Windows PC
- USB to UART TTL adapter
Software Tools
List of Acronyms
| Acronym | Definition |
|---|---|
| DFU | Device Firmware Upgrade |
| JTAG | Joint Test Action Group |
| LoRa | Long Range |
| OTAA | Over-The-Air-Activation |
| ABP | Activation-By-Personalization (ABP) |
| TTN | The Things Network |
| TTS | The Things Stack |
Product Configuration
Interfacing with RAK811
RAK811 module can be configured using AT commands via the UART interface. You need a USB to UART TTL adapter to connect the RAK811 to the PC's USB port and a serial terminal tool. It is highly recommended to use RAK Serial Port Tool so you can easily send AT commands and view the replies from the console output.
Connect to the RAK811
- Connect the RAK811 to the serial port of a general-purpose computer (USB port) using a USB to UART TTL adapter, as shown in Figure 1.
Figure 1: RAK811 Module Connection-
Any serial communication tool can be used; but, it is recommended to use the RAK Serial Port Tool.
-
Configure the serial communication tool by selecting the proper port detected by the computer and configure the link as follows:
- Baud Rate: 115200 baud
- Data Bits: 8 bits
- Stop Bits: 1 stop bit
- Parity: NONE
- The RAK811 console output can be read in the RAK Serial Port Tool, as shown in Figure 2.
Figure 1: RAK Serial Port Tool Connected to RAK811 moduleConfiguring RAK811
To connect the RAK811 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. Connect the RAK811 module to the computer as described in the previous section. Using the serial communication tool, for example, the RAK Serial Port Tool, it is possible to send commands to the RAK811. For example, sending the at+set_config=device:restart and at+version commands will display the current firmware version as shown in Figure 3. For more supported commands, refer to the AT Commands for RAK811.
Figure 1: AT Command responseConnecting to The Things Stack (TTN V3)
This section will show how to connect the RAK811 module to The Things Stack (TTN V3) platform.
Figure 1: The Things Stack diagramAs shown in Figure 4, The Things Stack is an open-source LoRaWAN Network Server suitable for global, geo-distributed public and private deployments as well as for small, local networks. The architecture follows the LoRaWAN Network Reference Model for standards compliancy and interoperability. This project is actively maintained by The Things Industries.
LoRaWAN is a protocol for low-power wide-area networks. It allows for large-scale Internet of Things deployments where low-powered devices efficiently communicate with Internet-connected applications over long-range wireless connections.
The RAK811 module can be part of this ecosystem as a device, and the objective of this section is to demonstrate how simple it is to send data to The Things Stack using the LoRaWAN protocol. To achieve this, the RAK811 module must be located inside the coverage of a LoRaWAN gateway connected to The Things Stack server.
Registration to TTN and Creating LoRaWAN Applications
- The first step is to go to The Things Network platform and select a cluster, as shown in Figure 5. The Things Industries adds more clusters from time to time so select the one closes to your location. In this guide, Europe 1 is selected.
Figure 1: Selecting Cluster in TTN V3You can use the same login credentials on the TTN V2 if you have one. If you have no account yet, you need to create one.
- To register as a new user to TTN, click on Login with The Things ID then select register on the next page, as shown in Figure 6 and Figure 7.
Figure 1: Login using TTN account
Figure 1: Registration of new account-
You should now be on the step of creating your TTN account. Fill in all the necessary details and activate your account.
-
After creating an account, you should log in on the platform using your username/email and password then click Submit, as shown in Figure 8.
Figure 1: Logging in to TTN platform- You need to click Authorize to proceed.
Figure 1: Authorization to TTN- Now that you are logged in to the platform, the next step is to create an application. Click Create an application.
Figure 1: Creating TTN application for your LoRaWAN devices- To have an application registered, input first the specific details and necessary information about your application then click Create application.
Figure 1: Details of the TTN applicationIf you have no error on the previous step, you should now be on the application console page. The next step is to add end-devices to your The Things Stack application. LoRaWAN specifications enforce that each end device has to be personalized and activated. There are two options in registering devices depending on the activation mode selected. Activation can be done either via Over-The-Air-Activation (OTAA) or Activation-By-Personalization (ABP).
Once you have the application in The Things Stack (TTN V3), you need to ensure that you are in coverage of a LoRaWAN gateway that is registered to The Things Stack (TTN V3) as well. Without the coverage of that LoRaWAN gateway, you cannot activate any device that you will register in your application.
RAKwireless has LoRaWAN gateways that you can connect to The Things Stack (TTN V3) if no LoRaWAN gateway coverage is available in your location.
The Things Stack OTAA Device Registration
- Go to your application console to be able to register a device. To start adding an OTAA end device, you need to click + Add end device, as shown in Figure 12.
Figure 1: Add end device- To register the module, click first Manually then configure the activation method by selecting Over the air activation (OTAA) and compatible LoRaWAN version then click Start button, as shown in Figure 13 and Figure 14.
Figure 1: Manually register device to The Things Stack
Figure 1: Device activation configuration- Input a unique End device ID and EUIs (DevEUI and AppEUI), as shown in Figure 15. Check if your module has a DevEUI on sticker or QR that you can scan then use this as the device unique DevEUI.
Optionally, you can add a more descriptive End device name and End device description about your device.
- After putting all the details, click Network layer settings to proceed to the next step.
It is advisable to use a meaningful End device ID, End device name, and End device description that will match your device purpose. The End device ID rak-device is for illustration purposes only.
Figure 1: OTAA Device Information- Next step is to set up Frequency plan, compatible Regional Parameter version, and LoRaWAN class supported. Then you can click Join settings.
Figure 1: OTAA Configuration- The last step in the registration of a new OTAA end-device is the configuration of the AppKey. To get the AppKey, you must click the generate button. Then click Add end device to finish your new device registration.
Figure 1: OTAA AppKey generation and device registration- You should now be able to see the device on The Things Stack console after you fully register your device, as shown in Figure 18.
The AppEUI, DevEUI, and AppKey are the parameters that you will need to activate your LoRaWAN end device via OTAA. The AppKey is hidden by default for security reasons, but you can easily show it by clicking the show button. You can also copy the parameters quickly using the copy button.
The three OTAA parameters on The Things Stack device console are MSB by default.
These parameters are always accessible on the device console page, as shown in Figure 18.
Figure 1: OTAA device successfully registered to The Things StackRAK811 OTAA Configuration for The Things Stack
The RAK811 module supports a series of AT commands to configure its internal parameters and control the functionalities of the module. To set up the RAK811 module to join The Things Stack using OTAA, start by connecting the RAK811 module to the Computer (see Figure 1) and open the RAK Serial Port Tool. Wait for the communication to start. It is recommended to test the serial communication and verify the current configuration by sending either of these two AT commands:
at+set_config=device:restart
at+version
Figure 1: AT Command responseAs an example, these are the list of the parameters you need to configure in RAK811:
- LoRa join mode: OTAA
- LoRa class: Class A
- LoRa region: EU868
- Device EUI: 1133557799224466
- Application EUI: 1000000000000009
- Application Key: 04FA4E626EF5CF227C969601176275C2
- Set the LoRa join mode to OTAA.
at+set_config=lora:join_mode:0
- Set the LoRa class to Class A.
at+set_config=lora:class:0
- Set the frequency/region to EU868.
- Refer to the RAK811 Datasheet for the list of supported frequencies.
at+set_config=lora:region:EU868
- Set the Device EUI.
at+set_config=lora:dev_eui:1133557799224466
- Set the Application EUI.
All zero value Application EUI at+set_config=lora:app_eui:0000000000000000 is not supported and will return error.
at+set_config=lora:app_eui:1000000000000009
- Set the Application Key.
at+set_config=lora:app_key:04FA4E626EF5CF227C969601176275C2
Figure 1: Configuring LoRa ParametersAfter configuring all the parameters, you need to reset your RAK811 Module to save the the parameters.
- After resetting, join in OTAA mode.
at+join
After 5 or 6 seconds, if the request is successfully received by a LoRa gateway, then you should see the messages, shown in Figure 21.
- Try to send a message from the RAK811 module.
at+send=lora:2:1234567890
Figure 1: OTAA Test Sample Data Sent via RAK Serial Port ToolYou can see the data sent by the RAK811 module on The Things Stack platform, as shown in Figure 22.
Figure 1: OTAA Test Sample Data Sent Viewed in The Things StackThe Things Stack ABP Device Registration
- To register an ABP device, you need to go to your application console and select the application where you want your device to be added. Then click + Add end device, as shown in Figure 23.
Figure 1: Add end device- To register the module, click first Manually then configure the activation method by selecting Activation by personalization (ABP), compatible LoRaWAN version, and click Start button, as shown in Figure 24 and** Figure 25**.
Figure 1: Add end device
Figure 1: Manually register device to The Things Stack- At this step, input a unique End device ID and DevEUI, as shown in Figure 26. Check if your module has a DevEUI on sticker or QR that you can scan then use this as the device unique DevEUI.
Optionally, you can add a more descriptive End device name and End device description about your device.
- After putting all the details, click Network layer settings to proceed to the next step.
It is advisable to use a meaningful End device ID, End device name, and End device description that will match your device purpose. The End device ID rak-device-abp is for illustration purposes only.
Figure 1: Device Information- Next step is to set up Frequency plan, compatible Regional Parameter version, and LoRaWAN class supported. In an ABP device, you also need to generate Device Address and NwkSKey (Network Session Keys). Then you can click Application layers settings.
Figure 1: ABP Configuration in The Things Stack- The last step in the registration of a new ABP end-device is the configuration of the AppSKey. To get the AppSKey, you must click the generate button, then click Add end device to finish your new device registration.
Figure 1: ABP Configuration in The Things Stack- You should now be able to see the device on The Things Stack console after you fully register your device, as shown in Figure 29.
Figure 1: RAK811 registered at The Things StackRAK811 ABP Configuration for The Things Stack
To set up the RAK811 module to join The Things Stack using ABP, start by connecting the RAK811 module to the Computer (see Figure 1) and open the RAK Serial Port Tool. It is recommended to test the serial communication by sending either of these two AT commands:
at+set_config=device:restart
at+version
Figure 1: AT Command responseAs an example, these are the list of the parameters you need to configure in RAK811:
- LoRa join mode: ABP
- LoRa class: Class A
- LoRa region: EU868
- Device address: 260BDE80
- Network Session Key: 433C7A924F7F6947778FE821525F183A
- Application Session Key: A585653A949C2B2D44B55E99E94CB533
- Set the LoRa join mode to ABP.
at+set_config=lora:join_mode:1
- Set the LoRa class to Class A.
at+set_config=lora:class:0
- Set the frequency/region to EU868.
- Refer to the RAK811 Datasheet for the list of supported frequencies.
at+set_config=lora:region:EU868
- Set the Device Address.
at+set_config=lora:dev_addr:260BDE80
- Set the LoRa Network Session Key.
at+set_config=lora:nwks_key:433C7A924F7F6947778FE821525F183A
- Set the LoRa Application Session Key.
at+set_config=lora:apps_key:A585653A949C2B2D44B55E99E94CB533
Figure 1: AT Command for ABP LoRa parameters via RAK Serial Port ToolAfter configuring all the parameters, you need to reset the RAK811 Module to save the parameters.
- After resetting, join in ABP mode.
at+join
By using the ABP mode in LoRaWAN, it doesn’t require to join a network before sending a LoRaWAN package. But to keep the consistency of internal states of the firmware of the RAK811 module, it is still required to send the at+join command in the ABP mode. This time, the firmware should reply almost immediately with an “OK”.
- Try to send data from the RAK811 to The Things Network in ABP mode.
at+send=lora:2:1234567890
Figure 1: ABP Test Sample Data Sent via RAK Serial Port ToolYou can see the data sent by the RAK811 module on The Things Stack device console Live data section and the Last seen info should be few seconds ago.
Figure 1: OTAA Test Sample Data Sent Viewed in The Things StackConnecting with ChirpStack
In this section, it shows how to connect the RAK811 module to the ChirpStack platform.
Figure 1: RAK811 Module in the Context of the ChirpStack PlatformThe ChirpStack or previously known as the LoRaServer project provides open-source components for building LoRaWAN networks. Like the case of The Things Stack, the RAK811 module is located in the periphery and will transmit the data to the backend servers through a LoRa gateway. Learn more about ChirpStack.
It is assumed that you are using RAK Gateway and its built-in ChirpStack or RAK cloud testing ChirpStack. Also, the gateway with the ChirpStack must be configured successfully. For further information, check the RAK documents for more details.
-
In summary, these are the requirements:
- Have ChirpStack online gateway, the frequency band of the nodes should be consistent with the frequency band of the gateway in use.
- The RAK Serial Port Tool provided by RAK
- RAK811 module
The frequency band used in the demonstration is EU868. Use a high-frequency version of RAK811. The product number should be “RAK811 (H)”.
Before you start, you must choose which mode you are going to use, whether in OTAA or ABP mode, to register the device to the network server.
Sign up and loginLogin to the ChirpStack server using your account and password.
Create a new Application
Go to the Application section, as shown in Figure 35.
Figure 1: Application SectionBy default, you should create a new application, although you can reuse the existing ones. For this setup, create a new Application by clicking on the “CREATE