Skip to main content

RAK4260 WisDuo Breakout 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 the steps in the installation guide of the RAK4260 Breakout Board, make sure to prepare the necessary items listed below:

Hardware Tools

  • RAK4260 Breakout Board (provided) – including LoRa antenna, Dupont lines (13x)
  • USB to UART adapter – CH340 for example (not provided)
  • RAKDAP1 DAPLink Tool (not provided)
  • Gateway in range, for testing (not provided)
  • Windows PC (not provided)

Software Tools

What's Included in the Package?

  • RAK4260 Breakout Board
  • LoRa antenna
  • Dupont lines (24x)

Product Configuration

Interfacing with RAK4260 Breakout Board

warning

Before powering the RAK4260 Breakout Board, make sure you have installed the included LoRa Antenna. Not doing so might damage the board.

USB to UART

  1. Connect your USB to the UART adapter to the pin header on the RAK4260 via a set of four (4) DuPont lines. See Figure 1 for reference on wiring the device properly.
Figure 7501: Powering up and interfacing with the board
  1. Go to your Device Manager by pressing Windows + R, and then type devmgmt.msc. Or, you can also search for devmgmt.msc in the Start Menu.

  2. Look for Ports (COM and LPT), and then find the name USB-SERIAL CH340. Take note of the COM Port Number as you will need it to connect with the board.

NOTE

Windows 10 should recognize the board and automatically install drivers. If you didn't find any port with the name USB-Serial CH340, make sure to install the CH340 Drivers in your Windows PC.

Figure 7502: COM Port settings
  1. Open the RAK Serial Port Tool. Select the COM Port number (the one you noted in the previous step) and set the Baud Rate to 115200. Click OPEN, and you should be connected to the board and be able to send commands.
Figure 7503: Configuring the RAK Serial Port Tool

DAPLink Connection

Connect the tool in accordance with the diagram shown in Figure 4 and Figure 5.

Figure 7504: DAPLink to RAK4260 Breakout Board
Figure 7505: DAPLink connection

Connecting to The Things Network (TTN)

The Things Network is about enabling low-power devices to be used in long-range gateways that connect to an open-source, decentralized network and exchange data with Applications. Learn more about The Things Network.

In this section, you will be connecting the RAK4260 Breakout Board to The Things Network (TTN).

  1. If you don't have an account yet, head on to the TTN site and create one. Once done, log in to your account and go to the console. Refer to Figure 7.
Figure 7506: The Things Network Home Page
Figure 7507: TTN Console Page
  1. Choose APPLICATIONS.
Figure 7508: Application Page

Adding an Application

  1. Click the add application button
Figure 7509: Adding an Application

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 - the handler you want to register this application to.
  1. After filling in the necessary information, press the Add application. If the page is the same as shown in Figure 10, then you have successfully registered your application.
Figure 7510: Application Overview

Register Device

  1. Scroll down until you see the Devices section. You can also click the Devices button at the top.
Figure 7511: Device Section
  1. Click Register device.
Figure 7512: Add your Device

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

  • Device ID - this is the unique identifier for your RAK4260 Breakout Board in your application. You need to enter this manually.
  • Device EUI - this is the unique identifier for your device in the network. You can change it later if you want.
  • App Key – this key will be used to secure the communication between the device and the network.
  • App EUI – a unique identifier of the Application that you are registering the device within.
  1. Populate the Device ID and Device EUI (generate a random one by pressing the arrows) fields and leave the rest as is. Click Register. Now, your device is registered under the corresponding application.
Figure 7513: Device Overview

In the Device Overview, there are two options for the Activation Method: OTAA and ABP. The default option is OTAA as shown above.

OTAA Mode

OTAA stands for Over-The-Air Activation. Detailed information about the OTAA will not be discussed in this document; however, the most important thing from a practical perspective is that a device needs to have the three (3) parameters: Device EUI, Application EUI, and App Key. It is already explained briefly in the previous section. It is set correctly in order for the LoRa Server to allow it to access the network.

These can be obtained from the Device Overview page, where they are grouped one after the other for convenience.

Figure 7514: Device Overview Parameters

As these are randomly generated by TTN, you need to update your RAK4260 Breakout Board with their values to register it with the network. However, as mentioned before, you can only do this directly in the source code, compile it and then flash it to the device.

The following section will guide you through the process of doing this with the Atmel Studio.

Parameter and Firmware Setup

Execute the following steps to connect your device with the TTN. Register and then fill in the parameters obtained upon registering.

Edit OTAA Parameters in the Code
  1. Open your Atmel Studio and navigate to the demo firmware you downloaded from the RAKwireless GitHub repository.
Figure 7515: Atmel Studio main page

2 Go to File → Open → Project/Solution.

Figure 7516: Open the sample project
  1. 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.
Figure 7517: Demo firmware project file
  1. Once your project has loaded up, you will be presented with a file structure that contains folders and files that you can edit. Copy the values of the three (3) parameters shown in Figure 14 and paste them into the conf_app.h file. This file is contained in the scr config folder that you can access via Solution Explorer tree.

Here are the required parameters:

  • Device EUI
  • Application EUI
  • Application Key
Figure 7518: Device configuration file (OTAA parameters)
  1. After replacing the default values with the one for the device you registered with TTN, you can proceed to compile the project.
NOTE

There is no need to edit anything else in order to compile the 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.
Figure 7519: Compiling the code
  1. The output should have no errors, as shown in Figure 20.
Figure 7520: Compiling the code
Flashing the Firmware
  1. Once compiled, you can find the output file in the Debug folder of the directory, where you downloaded the firmware. See Figure 21.
Figure 7521: Firmware .hex file
  1. As the firmware is now ready, you are going to proceed to flashing it. 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

Connect your USB to the UART adapter to the pin header on the RAK4260 via a set of four (4) DuPont lines. Refer to the Interfacing with RAK4260 Breakout Board section for more details.

Regional Band and Join Network Setup
  1. Upon opening the RAK Serial Port Tool, it should display the same details, as shown in Figure 22, provided it has been less than 5 seconds since you powered the board. The firmware is set to work in such a way that 5 seconds after powering the board it initializes with the default settings.
NOTE

EU868 is used for the region as an example. This section shows how to change the default region and connect with the network.

Figure 7522: Start up default output
  1. After the aforementioned 5-second elapse, the current configurations will be reported. These configurations are:
  • Class A
  • OTAA
  • Unconfirmed LoRa Frames
  • Fport - 1
NOTE

These settings are not adjustable at this stage. If you want to change them, you need to start over at the stage where you modify the firmware files before compiling them.

  1. If you use Figure 23 as a reference, you will see there is a list of four (4) options to choose from. Go to the Main Menu by sending a number 4.
Figure 7523: Configuration menu
  1. After which, send a number 1 to select EU868 Regional Band. You may also choose a different number as a selection depending on your case.
Figure 7524: Band selection menu
  1. Once you have selected the band, the device will automatically try to join to the LoRaWAN network using the Device EUI, Application EUI, and Application Key set in the firmware configuration file.
Figure 7525: Network join parameters set
  1. If the device is successful at joining the network, this will be reported with the Device Address that it has been assigned, and the parameters will be reported again (Class A, OTAA, etc.). You will be presented with the Configuration menu again in case you want to send another command. You will do this in the next section, where you will send some uplink data to the network.
Figure 7526: Successful network join
Uplink LoRa Frame Testing
  1. You should now be on the Main menu and have four options. This time select Option 2 to send an uplink LoRa Frame.
Figure 7527: Sending data to the server
NOTE

The firmware uploaded into the RAK4260 Breakout Board is just an example. Thus, the data sent are just dummy temperature readings (the original Microchip code was for a board with an actual temperature sensor). It will be reported as output together with the transmission is successful, as shown in Figure 28.

Figure 7528: Sending data to the server (successful)

This should be sufficient to prove that the board functions as intended, and it can send data over the network after successfully joining it. As this module is intended for development, the example firmware is limited to this functionality.

You can use this project as a base to develop a more complex firmware using the Microchip LoRaWAN Stack (MLS).