RAK4260 LPWAN Module User Guide

October 27, 2023
RAK

RAK4260 LPWAN Module User Guide
RAK4260 LPWAN Module

Prerequisites

What Do You Need?

Before going through the quick start guide of the RAK4260 WisDuo LPWAN Module, make sure to prepare the necessary items listed below:

Hardware Tools

  1. RAK4260 LPWAN Module
  2. USB to TTL Converter
  3. RAKDAP1 DAPLink Tool
  4. Gateway in range for testing
  5. Windows PC

Software Tools

  1. RAK Serial Port Tool
  2. RAK Device Firmware Upgrade (DFU) Tool
  3. Atmel Studio
  4. Sample Code

Product Configuration

Interfacing with RAK4260

During the configuration of the module, a guided setup is available on the console output. You can connect to the console of the RAK4260 module through the UART interface.

Connect to the RAK4260

In this document, a RAK4260 module is used as an example. Use a USB to TTL converter to connect to the module.

  1. Connect the RAK4260 to the USB port of a general-purpose computer (Windows PC) using a USB to TTL module (3.3 V), as shown in Figure 1.
    Product Configuration

  2. Any serial communication tool can be used. However, it is recommended to use the RAK Serial Port Tool .

  3. Configure the serial communication tool by selecting the proper port detected by the computer and configure the link as follows:
    Baud Rate: 115200 bauds
    Data Bits: 8 bits
    Stop Bits: 1 stop bit
    Parity: NONE

  4. The RAK4260 console output can now be read in the RAK serial port tool, as shown in Figure 2.
    Product Configuration

Before establishing a LoRa Connection using the RAK4260 Module, several configurations must be set first, which will be discussed in the next sections.

Connecting to the Things Network (TTN)

In this section, a practical exercise will be performed to show how to connect the RAK4260 module to The Thing Network (TTN) platform.
Product Configuration

As shown in Figure 3, the RAK4260 module is one of the devices located on the left side. In the context of an IoT solution, the objective is to deploy devices to sense the relevant process variables and transmit the data to the backend servers located in the cloud. The data will be processed and integrated as part of a larger solution that could generate efficiency, traceability, and predictability capacity among others.

The RAK4260 module can be part of this ecosystem, and the objective of this section is to demonstrate how simple to send data to the TTN using the LoRaWAN protocol. To achieve this, the RAK4260 module must be located inside of the coverage of a LoRaWAN gateway.

Sign up and log in

If you don’t have an account yet, head on to the TTN website and create one. Once done, log in to your account and go to the Console.

Product Configuration
Product Configuration

Create a New Application

  1. Choose the APPLICATIONS.
    Product Configuration

  2. Click the “add application” button.
    Product Configuration

    • Here are the things that you should take note of in adding an application:
    • Application ID – this will be the unique ID of your application in the Network. Note that the characters should be in lower case, no spaces are allowed.
    • Description – this is a short and concise human-readable description of your application.
    • Application EUI – this will be generated automatically by The Things Network for convenience.
    • Handler Registration – handler you want to register this application to.
  3. After you fill in the necessary information, press the “Add application” button at the bottom of this page. If you see a similar page, as shown in Figure 8, then you have successfully registered your application.
    Product Configuration

Register a New Device

  1. Scroll down until you see the Devices section. Or, you can click the “Devices” button at the top.
    Product Configuration

  2. Then, register a new device by clicking on the “register devices”.
    Product Configuration
    In this form, the device ID must be unique for the application and must be completed with lower case, alphanumeric characters. The rest of the parameters in the form are very important for the LoRaWAN protocol:

    • Device EUI
    • Application Key
    • Application EUI
      The TTN platform can generate these parameters randomly by leaving those fields empty, or you can enter already existing values.
  3. Press the “Register” button at the bottom of this page to finish the process.
    Product Configuration

Configuring RAK4260 LPWAN Module

To connect the RAK4260 module to a LoRa P2P Connection or a LoRaWAN network, the module must be configured and LoRa parameters must be set properly. This can be done by modifying the LoRa parameters on the firmware source code and flashing it into the module. The following section will guide you through the processof doing this using Atmel Studio.

Parameter and Firmware Setup

To connect your device with TTN, execute the following steps. To do this, fill in the parameters obtained when setting up the TTN.

Edit OTAA Parameters in the Code

  1. Open your Atmel Studio and navigate to the demo firmware you downloaded from the RAKwireless GitHub repository.
    Product Configuration

  2. Go to File → Open → Project/Solution.
    Product Configuration

  3. Go to the folder where you downloaded the GitHub repository, and select the “APPS_ENDDEVICE_DEMO1” project file (it is in the directory with the same name as the file). Then click Open.
    Product Configuration

  4. Once your project has loaded up, you will be presented with a file structure that contains folders and files that you can edit. You need to copy the values of the three (3) parameters shown in Figure 11 (Device, Application EUI, and Application Key) into the corresponding fields in the “conf_app.h” file. It is contained in the scr config folder that you can access via Solution Explorer tree.
    Product Configuration

  5. After replacing the default values with the one for the device you registered with TTN, you can proceed to compile the project. There is no need to edit anything else in order to compile firmware that will allow you to connect to the TTN network.

Compile the Code

  1. Compile the code by going to the Build → Build Solution.
    Product Configuration

  2. The output should have no errors, as shown in Figure 17
    Product Configuration

Flashing the Firmware

Once compiled, you can find the output file in the “Debug” folder of the directory where you downloaded the firmware. See Figure 18.

  • As the firmware is ready, proceed to flashing it. In order to do this, you need to utilize your RAKDAP1 hardware tool and the pyocd software tool.

Flash the Firmware Using RAKDAP1

Refer to the RAKDAP1 Flash and Debug Tool.

Connecting to TTN

  1. Connect your USB to the TTL adapter to the corresponding pins of RAK4260, which have been discussed in the earlier section. Refer to Figure 1.
    Use the serial communication tool to use the guided setup. Based on the firmware you flashed to the RAK4260 Module, it is configured in OTAA Mode. To initiate the connection to TTN, press the key “1” to enter into the Demo Application. A list of frequencies will appear on the console output, choose the one that suits your application. In this example, EU868 is used for the region, since it was the configured parameter at the LoRa gateway. Sample console output is shown in Figure 19.
    Product Configuration

  2. Make sure to set the proper configuration in-line with the LoRa Gateway settings to successfully connect the RAK4260 module to a LoRa network.
    Product Configuration

  3. Try to send data after a successful connection to the TTN, by pressing the key “2” for the “Send Data” option.
    Product Configuration

  4. As you can see, the sample data were sent successfully and should be expected to appear on TTN Console.
    Product Configuration

Connecting to ChirpStack

This section shows how to connect the RAK4260 LPWAN Module to the ChirpStack platform. As described in the ChirpStack website:

“ChirpStack provides open-source components for LoRaWAN networks. Together they form a ready-to-use solution including a user-friendly web interface for device management and APIs for integration. The modular architecture makes it possible to integrate within existing infrastructures. All components are licensed under the MIT license and can be used for commercial purposes.”
Product Configuration

The architecture of the ChirpStack platform is shown in the previous figure. Similar to the case of TTN, the RAK4260 Module is an End Device and will transmit the data to the backend servers through a LoRa gateway.
For a more technical understanding of the ChirpStack components, refer to the Architecture page of ChirpStack.

NOTE:
To register the device to the ChirpStack network server, you must choose either ABP or OTAA mode.

Create a New Application

  1. To connect the RAK4260 Module to ChirpStack, first, you need to create an Application.

  2. Go to the Applications section then click on the “+ CREATE” button
    Product Configuration

  3. Create an Application named rak4260_node. Fill in the required fields, as shown in Figure 25.

  4. To finish, click the “CREATE APPLICATION” button.
    ChirpStack LoRaServer supports multiple system configurations, with only one by default. By default, a new Application should be created, although it is possible to reuse the existing ones.

  • Application Name: rak4260_node
  • Application Description: RAK4260 Module application
  • Service profile: This field will select the system profile.

The Application Description field is just a descriptive text.
Product Configuration

Registering a New Device

  1. Click on the Application rak4260_node created in the previous step.
    Product Configuration

  2. Select the “DEVICES” tab, as shown in Figure 28.
    Product Configuration

  3. Inside the “DEVICES” tab, create a new device (LoRa node) by clicking on the “+ CREATE” button.
    Product Configuration
    Product Configuration

  4. Fill in the parameters requested as appears in Figure 30:

    • Device name and Device description: These are just descriptive texts.
    • Device EUI: This interface allows you to generate a Device EUI automatically by clicking the icon highlighted in red in Figure 31. You can also add a specific Device EUI directly in the form.
    • Device-profile: To join in OTAA mode, select “device_profile_otaa” or “device_profile_abp” to join in ABP mode.
      NOTE:
      ChirpStack doesn’t support AS923 in ABP mode.
  5. Press the “CREATE DEVICE” button at the bottom of this page to finish the device registration.
    Product Configuration

LoRaWAN Join Mode

The LoRaWAN specification defines that to join a LoRaWAN network, each end- device has to be personalized and activated. Activation can be done either via Over-The-Air-Activation (OTAA) or via Activation-By-Personalization (ABP). In OTAA, the end-device previously personalized is activated when is deployed or reset. In ABP, personalization and activation are done as a single step.

OTAA Mode
Configure the OTAA Mode on the Platform

  1. If you have selected “device_profile_otaa”, then after the device is created, an “Application Key” must be also created for this device.
    Product Configuration

  2. A previously created “Application Key” can be entered here, or a new one can be generated automatically by clicking the icon highlighted in red.
    Product Configuration

  3. Once the Application Key is added to the form, the process can be finalized by clicking the “SET DEVICEKEYS” button.

    • As shown in Figure 34, a new device should be listed in the “DEVICES” tab. The most important parameters, such as the “Device EUI”, are shown in the summary
      Product Configuration
  4. To end the process, it is a good practice to review that the Application Key” is properly associated with this device. The “Application Key” can be verified in the “KEYS(OTAA)” tab.
    Product Configuration

 NOTE:
Standard OTAA mode requires the Device EUI, Application Key, and the Application EUI. But in ChirpStack’s implementation, only Device EUI and the Application Key are mandatory. The Application EUI is not required and is not recorded in the Application tab.

ABP Mode
Configure the ABP Mode on the Platform

During the registration of a new device, if “device_profile_abp” is selected, then the ChirpStack platform will assume that this device will join the LoRaWAN network using the ABP mode.

  1. Fill in the parameters requested as appears in Figure 36:
    • Device name and Device description: These are just descriptive texts.
    • Device EUI: You can also add a specific Device EUI directly in the form.
  2. Once these parameters are filled, click the “CREATE DEVICE” button.
    NOTE:
    Check the Disable frame-counter validation to prevent the node-side counting the frame starting from zero after the node is powered on during the test, and the server cannot synchronize the node-side counting, causing the transmission to fail.
    Product Configuration

After selecting the ABP mode, the following parameters appear in the “ACTIVATION” tab, as shown in Figure 37.

  • Device address

  • Network session key

  • Application session key
    Product Configuration

  • The parameters can be generated as random numbers by the platform or can be set with values. Once these parameters are filled properly, the process is completed by clicking on the “(RE)ACTIVATE DEVICE” button.

Capturing LoRaWAN Frames on ChirpStack Console

View LoRaWAN OTAA Frames

  1. Go to Applications -> rak4260-node -> Devices -> rak4260-node, then select the “LORAWAN FRAMES” tab.
    Product Configuration

  2. Go to Applications -> rak4260-node -> Devices -> rak4260-node, then select “DEVICE DATA” tab.
    Product Configuration

View LoRaWAN ABP Frames

  1. Go to Applications -> rak4260-node -> Devices -> rak4260-abp, then select the “LORAWAN FRAMES” tab.
    Product Configuration

  2. Go to Applications -> rak4260-node -> Devices -> rak4260-abp, then select the “LORAWAN FRAMES” tab.
    Product Configuration

Miscellaneous

Firmware Upgrade Through DAPLink

Refer to the RAKDAP1 Flash and Debug Tool guide in the Accessories Category.

References

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

RAK User Manuals

Related Manuals