Skip to main content

RAK811 Breakout Board Quick Start Guide

Prerequisites

What Do You Need?

Before going through each and every step in the installation and guide of the RAK811 Breakout Board, make sure to prepare the necessary items listed below:

Hardware Tools

  1. RAK811 Breakout Board
  2. RAKDAP1 Flash and Debug Tool
  3. Gateway in Range for Testing
  4. Jumper Wires
  5. 3.3 V Battery Power Supply
  6. A Windows/Mac OS/Linux Computer

Software Tools

  1. RAK Serial Port Tool
  2. RAK811 Breakout Board Firmware
  3. RAK Device Firmware Upgrade (DFU) Tool
NOTE

The bootloader of the RAK811 Breakout Board is already pre-installed upon manufacturing, so flashing the bootloader is not necessary for you to perform. If you find that the bootloader of your RAK811 Breakout Board damaged, kindly contact our support though our RAKwireless forum. However, if you want to upgrade the firmware of the device, refer to the miscellaneous section of this document.

What's included in the package?

  • 1 pc - RAK811 Breakout Board (chipset pre-soldered on the board)
  • 1 pc - LoRa Antenna

Product Configuration

Interfacing with RAK811 Breakout Board

RAK811 Breakout Board can be configured using AT commands via UART interface. You need a USB to UART TTL adapter to connect the RAK811 to 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.

warning

Before powering the RAK811 Breakout Board, you should install the LoRa antenna first. Not doing so might damage the board.

  • Connect your RAK811 Breakout Board with the following diagram below.
  • Figure 1 shows the Pinout Diagram of the Board and Figure 2 shows how to connect the RAK811 Breakout Board to the RAKDAP1.
Figure 8287: RAK811(H) Breakout Board Pinout Diagram
Figure 8288: RAKDAP1 to RAK811 Breakout Board Connection
  • Connect your RAKDAP1 Flash and Debug Tool to your Windows Machine then open RAK Serial Port Tool and select the right COM port:
Figure 8289: Correct Port Number and Correct Baud rate

Connecting to The Things Stack (TTN V3)

This section will show how to connect the RAK811 Breakout Board to The Things Stack (TTN V3) platform.

Figure 8290: The Things Stack diagram

As 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 Board 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 Board 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 8291: Selecting Cluster in TTN V3

You 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 Figures 6 and 7.

Figure 8292: Login using TTN account
Figure 8293: Registration of new account

You should now be on the step of creating your TTN account. Fill 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 8294: Logging in to TTN platform

You need to click Authorize to proceed.

Figure 8295: 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 8296: Creating TTN application for your LoRaWAN devices

To have an application registered, you need to input first the specific details and necessary information about your application then click Create application.

Figure 8297: Details of the TTN application

If 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 specification 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).

NOTE

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 available in your location.

The Things Stack OTAA Device Registration

You need to 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 8298: Add end device

To register the module, you need to 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 8299: Manually register device to The Things Stack
Figure 8300: Device activation configuration

Then you need to put 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, you need to click Network layer settings to proceed to the next step.

NOTE

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 8301: OTAA Device Information

Next step is to setup Frequency plan, compatible Regional Parameter version, and LoRaWAN class supported. Then you can click Join settings.

Figure 8302: 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 you need to click Add end device to finish your new device registration.

Figure 8303: OTAA AppKey generation and device registration

You should now be able to see the device on The Things Stack console after you fully registered your device, as shown in Figure 18.

NOTE

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 8304: OTAA device successfully registered to The Things Stack

RAK811 OTAA Configuration for The Things Stack

The RAK811 Board supports a series of AT commands to configure its internal parameters and control the functionalities of the module. To set up the RAK811 Board to join The Things Stack using OTAA, start by connecting the RAK811 Board 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 8305: AT Command response

As 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
  1. Set the LoRa join mode to OTAA.
at+set_config=lora:join_mode:0
  1. Set the LoRa class to Class A.
at+set_config=lora:class:0
  1. Set the frequency/region to EU868.
at+set_config=lora:region:EU868
  1. Set the Device EUI.
at+set_config=lora:dev_eui:1133557799224466
  1. Set the Application EUI.
NOTE

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
  1. Set the Application Key.
at+set_config=lora:app_key:04FA4E626EF5CF227C969601176275C2
Figure 8306: Configuring LoRa Parameters
NOTE

After configuring all the parameters, you need to reset your RAK811 Board for saving the parameters.

  1. 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.

  1. Try to send a message from the RAK811 Board.
at+send=lora:2:1234567890
Figure 8307: OTAA Test Sample Data Sent via RAK Serial Port Tool

You can see the data sent by the RAK811 Board on The Things Stack platform, as shown in Figure 22.

Figure 8308: OTAA Test Sample Data Sent Viewed in The Things Stack

The 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 you need to click + Add end device, as shown in Figure 23.

Figure 8309: Add end device

To register the module, you need to 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 8310: Add end device
Figure 8311: Manually register device to The Things Stack

At this step, you need to put 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, you need to click Network layer settings to proceed to the next step.

NOTE

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 8312: 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 8313: 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 you need to click Add end device to finish your new device registration.

Figure 8314: ABP Configuration in The Things Stack

You should now be able to see the device on The Things Stack console after you fully registered your device, as shown in Figure 29.

Figure 8315: RAK811 registered at The Things Stack

RAK811 ABP Configuration for The Things Stack

To set up the RAK811 Board to join The Things Stack using ABP, start by connecting the RAK811 Board 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 8316: AT Command response

As 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
  1. Set the LoRa join mode to ABP.
at+set_config=lora:join_mode:1
  1. Set the LoRa class to Class A.
at+set_config=lora:class:0
  1. Set the frequency/region to EU868.
at+set_config=lora:region:EU868
  1. Set the Device Address.
at+set_config=lora:dev_addr:260BDE80
  1. Set the LoRa Network Session Key.
at+set_config=lora:nwks_key:433C7A924F7F6947778FE821525F183A
  1. Set the LoRa Application Session Key.
at+set_config=lora:apps_key:A585653A949C2B2D44B55E99E94CB533
Figure 8317: AT Command for ABP LoRa parameters via RAK Serial Port Tool
NOTE

After configuring all the parameters, you need to reset RAK811 Board for saving the parameters.

  1. After resetting, join in ABP mode.
at+join
NOTE

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 Board, it still required to send at+join command in the ABP mode. This time, the firmware should reply almost immediately with an “OK”.

  1. Try to send a data from the RAK811 to The Things Network in ABP mode.
at+send=lora:2:1234567890
Figure 8318: ABP Test Sample Data Sent via RAK Serial Port Tool

You can see the data sent by the RAK811 Board on the The Things Stack device console Live data section and the Last seen info should be a few seconds ago.

Figure 8319: OTAA Test Sample Data Sent Viewed in The Things Stack

Connecting to ChirpStack

The ChirpStack or previously known as LoRaServer project provides open-source components for building LoRaWAN networks. To learn more about ChirpStack, visit their website.

You can use RAK811 Breakout Board to connect with ChirpStack according to the following steps:

NOTE

In this document, it is assumed that you are using RAK Gateway and its built-in ChirpStack or RAK cloud testing ChirpStack. Also, the RAK Gateway with Chirpstack must be configured successfully.

  1. Open the web page of the ChirpStack, which you want to connect with and login.

  2. By default, there is already one or more items in this page. You can either use it or create a new item, but for this, create a new item by clicking the “CREATE” button.

Figure 8320: ChirpStack Applications
  1. Fill up the necessary information then Click "CREATE APPLICATION”.
Figure 8321: Creating the Application
  1. Click the new item name “RAKwireless_Test_Application”:
Figure 8322: Applications page in ChirpStack
Figure 8323: RAK811 Breakout Board Application
  1. Add a Node device into ChirpStack by clicking the “CREATE” button.
Figure 8324: Adding a Node Device
  1. Fill them in. You can generate a Device EUI automatically by clicking the Device EUI icon, or you can write the correct Device EUI in the edit box.
Figure 8325: Filling the Device Parameters
NOTE
  • If you want to join in OTAA mode, select “DeviceProfile_OTAA” in the “Device-profile” item.
  • If you want to join in ABP mode and CN470 frequency, select “DeviceProfile_ABP_CN470” in the “Device-Profile” item.
  • If you want to join in ABP mode and other frequencies except AS923 and CN470, select “DeviceProfile_ABP” in the “Device-profile” item.

OTAA Mode

  1. To join ChirpStack in OTAA mode, select “DeviceProfile_OTAA”.
Figure 8326: Selecting OTAA Activation Mode in ChirpStack
  1. Press “CREATE DEVICE” button. You may write the application key by yourself or generate it automatically by clicking the icon highlighted in Figure 41.
Figure 8327: Application Key Generation
  1. Click "SET DEVICE KEYS” button. Now, you’ve completed the configuration on ChirpStack.
  • The Device EUI, which was set in the previous section to your RAK811 Breakout Board as "dev_eui" is the same as highlighted in Figure 42.
Figure 8328: Device EUI Code
  • The same with the Application Key, it was also set in the previous section as "app_key", and it should be the same as highlighted in Figure 43.
Figure 8329: Application Key LoRaWAN
NOTE

The Application EUI which was into RAK811 Breakout Board as “app_eui” is not needed for ChirpStack.

  1. Next, configure RAK811 Breakout Board by using AT commands. To do this, connect your RAK811 Breakout Board to a PC, power it on and open RAK Serial Port Tool on your computer.
at+version
Figure 8330: RAK Serial Port Tool
  • Now, join your RAK811 Breakout Board using the OTAA activation mode.
  1. If the join mode is not in OTAA, just set the LoRa join mode to OTAA and LoRa class to Class A by typing the AT commands shown in Figure 45.
at+set_config=lora:join_mode:0
at+set_config-lora:class:0
Figure 8331: Setting of LoRaWAN mode and class
  1. Type the following AT command to set the Frequency/Region, Device EUI, Application EUI, and Application Key. Remember to replace "XXX" and "XXXX" with the parameters set in the previous steps.
at+set_config=lora:region:EU868
at+set_config=lora:dev_eui:XXXX
at+set_config=lora:app_eui:XXXX
at+set_config=lora:app_key:XXXX
Figure 8332: Setting of Frequency and Device EUI
Figure 8333: Setting of Application EUI and Key
  1. Then, join in OTAA mode.
at+join
Figure 8334: Joining in OTAA
  • Joined Successfully!
  1. You can view the "JoinRequest" and "JoinAccept" on the ChirpStack page.
Figure 8335: Join Request of the Device in the ChirpStack
  1. Try sending data from the RAK811 Breakout Board to the ChirpStack by typing the command below in the serial port.
at+send=lora:2:1234567890
Figure 8336: Sending Data to ChirpStack

You can see the message on ChirpStack page, as shown in Figure 51.

Figure 8337: Message Received in ChirpStack

ABP Mode

  1. If you select “DeviceProfile_ABP” or "DeviceProfile_ABP_CN470”, it means you want to join ChirpStack in ABP mode.
warning

Frequency AS923 in ABP Mode is not supported in Chirpstack.

Figure 8338: Chirpstack ABP Activation
  1. Then, you can see that there are some parameters for ABP in the “ACTIVATION” item.
Figure 8339: Chirpstack ABP Activation Parameters Needed
  1. Use these parameters to set RAK811 Breakout Board by using AT command. To set LoRa join mode to ABP, type the following command:
at+set_config=lora:join_mode:1
Figure 8340: Chirpstack ABP Join Mode via RAK Serial Port Tool
  1. Set LoRa class to Class A.
at+set_config=lora:class:0
Figure 8341: Chirpstack ABP Set Class via RAK Serial Port Tool
  1. Set the frequency/region to EU868.
at+set_config=lora:region:EU868
Figure 8342: Chirpstack ABP Set Region/Frequency via RAK Serial Port Tool
  1. Set the Device Address.
at+set_config=lora:dev_addr:XXXX
Figure 8343: Chirpstack ABP Set Device Address via RAK Serial Port Tool
  1. Set the Network Session Key.
at+set_config=lora:nwks_key:XXXX
Figure 8344: Chirpstack ABP Set Network Session Key via RAK Serial Port Tool
  1. Set the Application Session Key.
at+set_config=lora:apps_key:XXXX
Figure 8345: Chirpstack ABP Set Application Session Key via RAK Serial Port Tool
NOTE

After configuring all the parameters, you need to reset your RAK811 Breakout Board to save the parameters.

  1. After resetting RAK811 Breakout Board, join in ABP mode.
at+join
Figure 8346: Chirpstack ABP Join via RAK Serial Port Tool
NOTE

Actually, it is not needed to join in ABP mode, but you still need to set this AT command to validate the parameters you just set for ABP mode.

  1. Try to send a data from RAK811 Breakout Board to ChirpStack.
at+send=lora:2:1234567890
Figure 8347: Chirpstack Sample Data Sent via RAK Serial Port Tool
  • You can then see the data, which is just sent from RAK811 Breakout Board on ChirpStack page:
Figure 8348: Chirpstack Data Received Preview

LoRa P2P Mode

This section shows how to use LoRa P2P mode. You will be using EU868 as the frequency, although it is applicable to other standard bands.

  1. First, find two RAK811 Breakout Board which can work on EU868 frequency and make sure their firmware version isn’t less than V3.0.0.1.

  2. Next, connect these two RAK811 Breakout Board with PC through UART, and open two serial port tool on PC.

  3. Set the RAK811 to work in LoRa P2P mode. Open the RAK Serial Port Tool and send the following command:

at+set_config=lora:work_mode:1
Figure 8349: P2P Initialization
  1. Then, configure LoRa P2P parameters for both of them.
at+set_config=lorap2p:XXX:Y:Z:A:B:C

For this example, the LoRa parameters are the following:

  • Link frequency: 869525000 Hz
  • Spreading factor: 7
  • Bandwidth: 125 kHz
  • Coding Rate: 4/5
  • Preamble Length: 5
  • Power: 5 dBm
NOTE

Refer to the Configuring Using AT Commands section to learn more about the definition of the parameters used.

Hence, it is translated into the following RAK811 AT command and sent to both units.

at+set_config=lorap2p:869525000:7:0:1:5:5
Figure 8350: Configuring P2P in both RAK811 Breakout Board Nodes
  1. Set the transmission mode of the module. Unit 1 is configured as the sender, and Unit 2 is set to the receiver by AT command.
at+set_config=lorap2p:transfer_mode:2

at+set_config=lorap2p:transfer_mode:1
Figure 8351: Setting Modes in both RAK811 Module
  1. Try sending a message from Unit 1 to Unit 2.
at+send=lorap2p:1234567890
Figure 8352: Message sent and received status in the two modules

You have successfully finished your RAK811 Breakout Board set up.

Miscellaneous

Upgrading the Firmware

NOTE

For RAK811 modules with firmware version V3.0.0.12 and below, you need to use the STM32CubeProgrammer to upgrade your firmware and upload the .hex file (not the .bin file) of the latest RAK811 firmware. The lower versions of the firmware have a different bootloader code and will not work on the RAK DFU Tool.

Execute the following procedure to upgrade the firmware in Device Firmware Upgrade (DFU) mode through the UART1 interface.

  1. Download the latest application firmware of the RAK811 that can be found on the datasheet.

  2. Download and open the RAK Device Firmware Upgrade (DFU) tool.

Figure 8353: RAK Upgrade Tool
  1. Click “Choose File” and choose the firmware you have downloaded for your desired frequency band.
Figure 8354: Choosing the Correct Upgrade file
  1. Click “Start” to upgrade. This may take a minute.
Figure 8355: Firmware Upgrading in Process
  1. You should see the same pop-window, as shown in Figure 62, if everything went well.
Figure 8356: Successfully Upgraded Firmware
  1. Now, CLOSE the upgrade tool and OPEN the serial port too, again.
  • It is recommended to use the RAK serial port tool since there are some ready AT commands in this tool that are very useful for you. You can get it from RAK website available for free at this RAK directory.
  1. Choose the correct COM port and set the baud rate to 115200. Then, open the serial port and enter the AT command shown below to restart. Another option is to press the RST button on the RAK811 Breakout Board.
at+set_config=device:restart

If you want to configure your RAK811 Breakout Board using the available AT commands, check the AT Commands for RAK811 Breakout Board.