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
- RAK811 Breakout Board
- RAKDAP1 Flash and Debug Tool
- Gateway in Range for Testing
- Jumper Wires
- 3.3 V Battery Power Supply
- A Windows/Mac OS/Linux Computer
Software Tools
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.
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.
- Connect your RAKDAP1 Flash and Debug Tool to your Windows Machine then open RAK Serial Port Tool and select the right COM port:
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.
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.
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.
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.
You need to click Authorize to proceed.
Now that you are logged in to the platform, the next step is to create an application. Click Create an application.
To have an application registered, you need to input first the specific details and necessary information about your application then click Create 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).
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.
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.
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.
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.
Next step is to setup Frequency plan, compatible Regional Parameter version, and LoRaWAN class supported. Then you can click Join settings.
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.
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.
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.
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
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
- 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 in the RAK811 Breakout Board 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
After configuring all the parameters, you need to reset your RAK811 Board for saving 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 Board.
at+send=lora:2:1234567890
You can see the data sent by the RAK811 Board on The Things Stack platform, as shown in Figure 22.
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.
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.
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.
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.
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.
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.
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
.
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
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
- 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 in the RAK811 Breakout Board 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
After configuring all the parameters, you need to reset RAK811 Board for saving 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 Board, it still required to send at+join command in the ABP mode. This time, the firmware should reply almost immediately with an “OK”.
- Try to send a data from the RAK811 to The Things Network in ABP mode.
at+send=lora:2:1234567890
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.
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:
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.
-
Open the web page of the ChirpStack, which you want to connect with and login.
-
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.
- Fill up the necessary information then Click "CREATE APPLICATION”.
- Click the new item name “RAKwireless_Test_Application”:
- Add a Node device into ChirpStack by clicking the “CREATE” button.
- 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.
- 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
- To join ChirpStack in OTAA mode, select “DeviceProfile_OTAA”.
- Press “CREATE DEVICE” button. You may write the application key by yourself or generate it automatically by clicking the icon highlighted in Figure 41.
- 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.
- 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.
The Application EUI which was into RAK811 Breakout Board as “app_eui” is not needed for ChirpStack.
- 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
- Now, join your RAK811 Breakout Board using the OTAA activation mode.
- 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
- 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
- Then, join in OTAA mode.
at+join
- Joined Successfully!
- You can view the "JoinRequest" and "JoinAccept" on the ChirpStack page.
- 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
You can see the message on ChirpStack page, as shown in Figure 51.
ABP Mode
- If you select “DeviceProfile_ABP” or "DeviceProfile_ABP_CN470”, it means you want to join ChirpStack in ABP mode.
Frequency AS923 in ABP Mode is not supported in Chirpstack.
- Then, you can see that there are some parameters for ABP in the “ACTIVATION” item.
- 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
- Set LoRa class to Class A.
at+set_config=lora:class:0
- Set the frequency/region to EU868.
at+set_config=lora:region:EU868
- Set the Device Address.
at+set_config=lora:dev_addr:XXXX
- Set the Network Session Key.
at+set_config=lora:nwks_key:XXXX
- Set the Application Session Key.
at+set_config=lora:apps_key:XXXX
After configuring all the parameters, you need to reset your RAK811 Breakout Board to save the parameters.
- After resetting RAK811 Breakout Board, join in ABP mode.
at+join
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.
- Try to send a data from RAK811 Breakout Board to ChirpStack.
at+send=lora:2:1234567890
- You can then see the data, which is just sent from RAK811 Breakout Board on ChirpStack page:
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.
-
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.
-
Next, connect these two RAK811 Breakout Board with PC through UART, and open two serial port tool on PC.
-
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
- 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
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
- 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
- Try sending a message from Unit 1 to Unit 2.
at+send=lorap2p:1234567890
You have successfully finished your RAK811 Breakout Board set up.
Miscellaneous
Upgrading the Firmware
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.
-
Download the latest application firmware of the RAK811 that can be found on the datasheet.
-
Download and open the RAK Device Firmware Upgrade (DFU) tool.
- Click “Choose File” and choose the firmware you have downloaded for your desired frequency band.
- Click “Start” to upgrade. This may take a minute.
- You should see the same pop-window, as shown in Figure 62, if everything went well.
- 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.
- 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.