Skip to main content

RAK4260 Evaluation Board Quick Start Guide

Prerequisites

The following two sections provide a list of the components and tools you need in order to get started with the development board. Some of the components are included in the package, others you need to provide yourself.

What Do You Need?

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

  1. RAK4260 Evaluation Board
  2. Gateway in range for testing (not provided)
  3. Micro USB Cable
  4. Windows PC
  5. RAKDAP1 DapLink Tool (not provided)

What's Included in the Package?

  • 1-pc RAK4260 EVB (RAK4261 + RAK5005)
  • 1-pc Micro USB Cable
  • 1-pc LoRa Antenna (iPEX)
  • 2-pcs 4-pin Header
  • 9-pcs Dupont Lines

Product Configuration

Interfacing with the RAK4260 Evaluation Board

To check if you have successfully flashed the custom firmware provided by RAKwireless correctly, download the RAK Serial Port Tool.

warning

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

  1. Connect your RAK4260 Evaluation Board to your Windows PC using the provided micro USB cable.
Figure 7549: RAK4260 Evaluation Board to Laptop Connection
  1. Open the RAK Serial Port Tool.
Figure 7550: RAK Serial Port Tool
  1. To find the correct COM Port number for your device, go to Device Manager by pressing Windows + R, and then type devmgmt.msc. Or, search for Device Manager in the Start Menu.
Figure 7551: Device Manager
  1. Look for Ports (COM & LPT) and find the name USB-SERIAL CH340. Take note of the COM Port Number.
NOTE

If you didn't find any port with the name USB-Serial CH340, make sure you have installed the CH340 Drivers on your Windows PC.

  1. Choose the Correct Port Number and Baud rate from the Device Manager, then click on the “OPEN” button.
Figure 7552: Correct Port Number and Baud rate

Connecting to The Things Network (TTN)

In this section, you will be connecting the RAK4260 Evaluation Board to The Things Network (TTN). If you don't have an account yet, head on to The Things Network website and create one. Once done, log in to your account and go to the console.

Figure 7553: The Things Network Home Page
Figure 7554: TTN Console Page
  • Choose “APPLICATIONS

Adding an Application

  1. Click on the “add application” button.
Figure 7555: Application Page
Figure 7556: Add Application Parameters

Here are the things that you should take note of in adding an application:

  • Application ID - a unique id of your application in the Network. Note that the characters should be in lower case, and no spaces are allowed.
  • Description - 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.
  1. After you fill in the necessary information, press the “Add application” button at the bottom of the page. If you see the same page, as shown in Figure 9, this means that you have successfully registered your application.
Figure 7557: Application Overview

Register Device

  1. Click “register device”.
Figure 7558: Device Section

Here are the things that you should take note of in registering your device:

  • Device ID - a unique identifier for your RAK4260 Evaluation Board in your application. You need to enter this manually.
  • Device EUI - a unique identifier for your device in the network. You can change it later if you want.
  1. Click on the highlighted in red icon and the Device EUI will be automatically generated. The App Key should be in auto-generation mode by default.
Figure 7559: Add your Device
  1. Lastly, click on the “Register” button. Now, your device is registered under the corresponding application.
Figure 7560: Register Device

TTN Device Overview

You can check all the parameters of the newly registered device created by clicking the “Overview”. The default join mode is OTAA.

Figure 7561: Device Overview
Testing RAK4260 LoRa Node demo

To test your project, you need to perform the steps below:

  1. Install the RAK4260 Development Platform.

  2. Check the join parameters, as shown in the TTN Device Overview. Modify and save the "conf_app.h" file.

Click to view the code
/*Define the Sub band of Channels to be enabled by default for the application*/
#define SUBBAND 1
#if ((SUBBAND < 1 ) || (SUBBAND > 8 ) )
#error " Invalid Value of Subband"
#endif

/* Activation method constants */
#define OVER_THE_AIR_ACTIVATION LORAWAN_OTAA
#define ACTIVATION_BY_PERSONALIZATION LORAWAN_ABP

/* Message Type constants */
#define UNCONFIRMED LORAWAN_UNCNF
#define CONFIRMED LORAWAN_CNF

/* Enable one of the activation methods */
#define DEMO_APP_ACTIVATION_TYPE OVER_THE_AIR_ACTIVATION
//#define DEMO_APP_ACTIVATION_TYPE ACTIVATION_BY_PERSONALIZATION

/* Select the Type of Transmission - Confirmed(CNF) / Unconfirmed(UNCNF) */
#define DEMO_APP_TRANSMISSION_TYPE UNCONFIRMED
//#define DEMO_APP_TRANSMISSION_TYPE CONFIRMED

/* FPORT Value (1-255) */
#define DEMO_APP_FPORT 1

/* Device Class - Class of the device (CLASS_A/CLASS_C) */
#define DEMO_APP_ENDDEVICE_CLASS CLASS_A
//#define DEMO_APP_ENDDEVICE_CLASS CLASS_C


/* ABP Join Parameters */

#define DEMO_DEVICE_ADDRESS 0x02603119

#define DEMO_APPLICATION_SESSION_KEY {0x00, 0x60, 0x10, 0x06, 0x30, 0x07, 0x04, 0x00, 0x69, 0x00, 0x60, 0xc0, 0x06, 0x90, 0x07, 0x04}
#define DEMO_NETWORK_SESSION_KEY {0x00, 0x40, 0x10, 0x06, 0x30, 0x07, 0x04, 0x00, 0x69, 0x00, 0x60, 0xc0, 0x06, 0x90, 0x07, 0x04}

/* OTAA Join Parameters */

#define DEMO_DEVICE_EUI { 0x00, 0xDB, 0x28, 0xAF, 0xE9, 0xAC, 0xCB, 0x22 }
#define DEMO_APPLICATION_EUI { 0x70, 0xB3, 0xD5, 0x7E, 0xD0, 0x03, 0x5D, 0x63 }
#define DEMO_APPLICATION_KEY { 0x3C, 0x6B, 0x36, 0x6C, 0xCA, 0xC3, 0x05, 0xE9, 0x3F, 0x0B, 0x6A, 0xC3, 0x03, 0xF0, 0x7C, 0x07 }

/* Multicast Parameters */
#define DEMO_APP_MCAST_ENABLE false
#define DEMO_APP_MCAST_GROUP_ADDRESS 0x0037CC56
#define DEMO_APP_MCAST_APP_SESSION_KEY {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6}
#define DEMO_APP_MCAST_NWK_SESSION_KEY {0x3C, 0x8F, 0x26, 0x27, 0x39, 0xBF, 0xE3, 0xB7, 0xBC, 0x08, 0x26, 0x99, 0x1A, 0xD0, 0x50, 0x4D}

/* This macro defines the application's default sleep duration in milliseconds */
#define DEMO_CONF_DEFAULT_APP_SLEEP_TIME_MS 5000

NOTE

You must choose one LoRaWAN activation method and modify the join parameter's definition. The join parameters and activation methods are defined in the conf_app.h file.

  1. Build the RAK4260 LoRa demo.

  2. Flash the firmware.

The default join mode is OTAA, and the default frequency is EU868. After resetting it, RAK4260 will join automatically if the dev_eui, app_eui, and app_key parameters have been configured correctly in the source code.

  1. Connect the RAK4260 Evaluation board and configure RAK Serial Port Tool.

  2. Press the “reset button” on your RAK5005 Baseboard Module. If everything works perfectly, you should see the same message shown in Figure 14.

Figure 7562: Serial Port Tool Successful Connection
  1. Choose Option 1 “Send Join Request” then click on the “SEND” button.
Figure 7563: Join parameters sent
  1. To send data from the RAK4260 to the TTN successfully, choose Option 2 then click on the “SEND” button.
Figure 7564: LoRaWAN data send
Figure 7565: LoRaWAN Transmission Success
  1. Data is now received by the TTN, as shown in Figure 18.
Figure 7566: Data received by the TTN

ABP Mode

Configure the ABP Mode on the Platform
  1. To join TTN in ABP mode, first, it is required to change the activation method to ABP. This is done on the TTN website under the “Device Settings” page.
Figure 7567: TTN Console, change the activation mode to ABP
  • For ABP mode, the TTN parameters needed are the following: Device Address, Network Session Key, and App Session Key.
NOTE

These fields can be left empty in the form and TTN will complete them with random values. In other cases, you can complete them with specific values.

Figure 7568: TTN Console ABP join parameters
  1. After completing the activation mode change, the device parameters will be summarized the same, as shown in Figure 21.
Figure 7569: TTN Console, ABP mode configuration finalized
  1. Update the join parameters on the “conf_app.h” file.

  2. Rebuild the RAK4260 LoRa demo.

Connecting to ChirpStack

This section shows how to connect the RAK4260 Evaluation Board 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.”

Figure 7570: RAK4260 Evaluation Board in the context of the ChirpStack platform

The architecture of the ChirpStack platform is shown in Figure 22. Similar to the case of TTN, the RAK4260 Evaluation board 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 Evaluation Board to ChirpStack, first, you need to create an Application.

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

Figure 7571: Creating a new Application on the RAK’s ChirpStack LoRaServer
  1. Create an Application named rak4260_node. Fill in the required fields, as shown in Figure 24.

  2. 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 EVB application
  • Service profile: This field will select the system profile.

The Application Description field is just a descriptive text.

Figure 7572: Filling parameters of an Application on the RAK’s ChirpStack LoRaServer

Registering a new device

  1. Click on the Application rak4260_node created in the previous step.
Figure 7573: List of applications created on the RAK’s ChirpStack LoRaServer
  1. Select the “DEVICES” tab, as shown in Figure 26.
Figure 7574: Device tab of an Application on the RAK’s ChirpStack LoRaServer
  1. Inside of the “DEVICES” tab, create a new device (LoRa node) by clicking on the “+ CREATE” button.
Figure 7575: Add a new device at DEVICES tab of an Application on the RAK’s ChirpStack LoRaServer
Figure 7576: New device registration form on the RAK’s ChirpStack LoRaServer
  1. Fill in the parameters requested as appears in Figure 28:
  • 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 29. 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.

  1. Press the “CREATE DEVICE” button at the bottom of this page to finish the device registration.
Figure 7577: Generate a new Device EUI in the device registration form

LoRaWAN Join Mode

The LoRaWAN specification defines that to join in 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.
Figure 7578: Choosing OTAA mode in the device registration form
  1. A previously created “Application Key” can be entered here, or a new one can be generated automatically by clicking the icon highlighted in red.
Figure 7579: Application Key for the OTAA mode in the device registration form
  1. Once the Application Key is added to the form, the process can be finalized by clicking the “SET DEVICE-KEYS” button.
  • As shown in Figure 32, a new device should be listed in the “DEVICES” tab. The most important parameters, such as the “Device EUI”, are shown in the summary.
Figure 7580: New crated device listed in the DEVICES tab
  1. 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.
Figure 7581: Application Key associated to the new device
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 34:
  • Device name and Device description: These are just descriptive texts.
  • Device EUI: You can also add a specific Device EUI directly in the form.
  1. 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.

Figure 7582: ChirpStack Console, configuring a device in ABP mode

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

  • Device address
  • Network session key
  • Application session key
Figure 7583: ChirpStack Console, parameters required for the ABP mode
  • 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.
Figure 7584: OTAA activation frame
  1. Go to Applications -> rak4260-node -> Devices -> rak4260-node , then select “DEVICE DATA” tab.
Figure 7585: Device data OTAA frame
View LoRaWAN ABP Frames
  1. Go to Applications -> rak4260-node -> Devices -> rak4260-abp, then select the “LORAWAN FRAMES” tab.
Figure 7586: LoRaWAN ABP frame
  1. Go to Applications -> rak4260-node -> Devices -> rak4260-abp, then select “DEVICE DATA” tab.
Figure 7587: Device data ABP frame

LoRa Simple P2P Demo

This example is based on Microchip demo: SAM R34 long-range P2P

Using this project, it is possible to send and receive messages to another nearby RAK4260. The messages can be unicast or broadcast and encrypted or not. The demo does not use RTOS but a task scheduler.

The RAK460 P2P demo can be cloned using the following link:

Use the p2p-rak4260 branch, as shown in Figure 40.

Figure 7588: LoRa P2P Demo clone project

Figure 7589: LoRa P2P Demo scanning channels
Figure 7590: Lora P2P Demo broadcast messages

Miscellaneous

RAK5005 Core Module Slot Connection to RAK4261

The RAK5005 is the base board that connects the RAK4260 Core Module. It creates the power supply for the attached module and provides additional IO and Sensor support for your project needs.

NOTE

RAK4261 is a circuit board module for RAK5005 with a pre-soldered RAK4260 LPWAN Module.

Listed below are the accessible pins and data bus of the attached RAK5005 base board on the RAK4260 EVB:

RAK4261 Pin DefinitionFunction Name of WisBasePin NumberPin NumberFunction Name of WisBaseRAK4261 Pin Definition
NCVBAT12VBATNC
GNDGND34GNDGND
3V33V3563V33V3
PA25_USB_PUSB+78USB-PA24_USB_N
NCVBUS910SW1NC
UART1_TX/PA04TXD01112RXD0UART1_RX/PA05
RSTRESET1314LED1PA27
PA06LED21516LED3PA07
3V3VDD1718VDD3V3
SDA/PA16I2C1_SDA1920I2C1_SCLSCL/PA17
PA08AIN02122AIN1PA09
NCBOOT02324NCNC
PA22_SSSPI_CS2526SPI_CLKPB23_SCK
PB02_MISOSPI_MISO2728SPI_MOSIPA23_MOSI
PB22IO12930IO2PA15
PA14IO33132IO4NC
UART3_TX/PA19TXD13334RXD1UART3_RX/PA18
NCI2C2_SDA3536I2C2_SCLNC
NCIO53738IO6NC
GNDGND3940GNDGND