RAK RAK3172 User manual

Documentation Center
RAK3172 Module Quick Start Guide
This guide covers the following topics:
TheThingsNetwork Guide - How to login, register new accounts and create new applications on TTN.
RAK3172 TTN OTAA Guide - How to add OTAA device on TTN and what AT commands to use on RAK3172
OTAA activation.
RAK3172 TTN ABP Guide - How to add ABP device on TTN and what AT commands to use on RAK3172 ABP
activation.
Chirpstack Guide - How to create new applications on Chirpstack.
RAK3172 Chirpstack OTAA Guide - How to add OTAA device to Chirpstack and what AT commands to use on
RAK3172 OTAA activation.
RAK3172 Chirpstack ABP Guide - How to add ABP device on Chirpstack and what AT commands to use on
RAK3172 ABP activation.
LoRa P2P - Point to point communication between two RAK3172 modules.
Updating RAK3172-Module FW - Procedures on how to update RAK3172 module firmware.
Prerequisites
What Do You Need?
Before going through the steps in the installation guide of the RAK3172 WisDuo LPWAN Module, make sure to
prepare the necessary items listed below:
Hardware Tools
1. RAK3172 WisDuo LPWAN Module
2. Computer
3. USB to UART TTL adapter
Software Tools
1. RAK Serial Port Tool
List of Acronyms

Documentation Center
Product Configuration
Interfacing with RAK3172
RAK3172 module can be configured using AT commands via the UART interface. You need a USB to UART TTL
adapter to connect the RAK3172 to your computer's USB port and a serial terminal tool. It is highly recommended
to use the RAK Serial Port Tool so you can easily send AT commands and view the replies from the console
output.
Connect to the RAK3172
1. Connect the RAK3172 to the serial port of a general-purpose computer (USB port) using a USB to UART TTL
adapter like RAKDAP1 , as shown in Figure 1.
Acronym Definition
DFU Device Firmware Upgrade
JTAG Joint Test Action Group
LoRa Long Range
OTAA Over-The-Air-Activation
ABP Activation-By-Personalization (ABP)
TTN The Things Network
DEVEUI Device EUI (Extended Unique Identification)
APPEUI Application EUI (Extended Unique Identification)
APPKEY Application Key
DEVADDR Device Address
NWKSKEY Network Session Key
APPSKEY Application Session Key
P2P Point-to-Point

Documentation Center
Figure 1: RAK3172 Module Connection
2. Any serial communication tool can be used; but, 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: 9600 baud
Data Bits: 8 bits
Stop Bits: 1 stop bit
Parity: NONE
Configuring RAK3172
To enable the RAK3172 module as a LoRa P2P module or a LoRaWAN end-device, the module must be
configured and parameters must be set by sending AT commands.
The first step is to connect the RAK3172 module to the USB-UART converter computer as described in the
previous section. Using a serial communication tool, you can now send commands to the RAK3172. For example,
sending AT will display OK . For the details of all supported AT commands, refer to AT Commands for RAK3172.
Connecting to The Things Network (TTN)
In this section, a quick tutorial guide will show how to connect the RAK3172 module to the TTN platform.
📝
NOTE:
In this guide, you need to have a working gateway that is connected to TTN or you have to be within
coverage of a TTN community network.
Figure 2: RAK3172 EVB in the context of the TTN
As shown in Figure 2, The Things Stack (TTN V3) 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 .

Documentation Center
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 RAK3172 WisDuo module 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
RAK3172 WisDuo module 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 on Figure 3.
Figure 3: 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 on figures 4 and 5.

Documentation Center
Figure 4: Login using TTN account
Figure 5: 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 login on the platform using your username/email and password then click
Submit as shown on Figure 6.

Documentation Center
Figure 6: Logging in to TTN platform
You need to click Authorize to proceed.
Figure 7: Authorization to TTN
Now that you are logged in to the platform, the next step is to create an application. Click Create an application.

Documentation Center
Figure 8: 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 9: Details of the TTN application
If you had no error during the previous step, you should now be on the application console page. The next step is
to add end-devices to your TTN application. LoRaWAN specification enforces that each end-device has to be
personalized and activated. There are two options for registering devices depending on the activation mode you
select. Activation can be done either via Over-The-Air-Activation (OTAA) or Activation-By-Personalization (ABP).
TTN 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 10.

Documentation Center
Figure 10: 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 on figures 11 and 12.
Figure 11: Manually register device to TTN

Documentation Center
Figure 12: Device activation configuration
Then you need to put a unique End device ID and EUIs (DevEUI and AppEUI) as shown on Figure 13. 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 13: OTAA Device Information
The next step is to set up the Frequency plan, a compatible Regional Parameter version and the LoRaWAN
class supported. Then you can click Join settings.

Documentation Center
Figure 14: 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 15: OTAA AppKey generation and device registration

Documentation Center
You should now be able to see the device on the TTN console after you fully register your device as shown in
Figure 16.
📝
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 reason 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 TTN device console are MSB by default.
These parameters are always accessible on the device console page as shown on Figure 16.
Figure 16: OTAA device successfully registered to TTN
OTAA Configuration for TTN
The RAK3172 module supports a series of AT commands to configure its internal parameters and control the
functionalities of the module.
To set up the RAK3172 module to join the TTN using OTAA, start by connecting the RAK3172 module to your
computer (see Figure 1) and open the RAK Serial Port Tool. Select the right COM port and set the baudrate to
9600.
It is recommended to start by testing the serial communication and verify that the current configuration is working
by sending these two AT commands:
ATE will echo the commands you input to the module, which is useful for tracking the commands and
troubleshooting.
AT
ATE

Documentation Center
You will receive OK when you input the two commands. After setting ATE , you can now see all the commands
you input together with the replies. Try again AT and you should see it on the terminal followed by OK as shown
in Figure 17.
📝
NOTE:
If do not receive an OK or any reply, you need to check if the wiring of your UART lines is correct and if
the baud is correctly configured to 9600. Also you can check if the device is powered correctly. If you are
getting power from USB port, ensure that you have a good USB cable.
Figure 17: at+version command response
The next step is to configure the OTAA LoRaWAN parameters in RAK3172:
LoRa work mode: LoRaWAN
LoRaWAN join mode: OTAA
LoRaWAN class: Class A
LoRaWAN region: EU868
Set the work mode to LoRaWAN.
Set the LoRaWAN activation to OTAA.
Set the LoRaWAN class to Class A.
AT+NWM=1
AT+NJM=1
AT+CLASS=A

Documentation Center
Set the frequency/region to EU868.
📝
NOTE:
Depending on the Regional Band you selected, you might need to configure the sub-band of your
RAK3172 to match the gateway and LoRaWAN network server. This is especially important for Regional
Bands like US915, AU915, and CN470.
To configure the masking of channels for the sub-bands, you can use the AT+MASK command that can be
found on the AT Commands Manual .
To illustrate, you can use use sub-band 2 by sending the command AT+MASK=0002 .
List of band parameter options
Code Regional Band
0 EU433
1 CN470
2 RU864
3 IN865
4 EU868
5 US915
6 AU915
7 KR920
8 or 8-1 AS923-1
8-2 AS923-2
8-3 AS923-3
8-4 AS923-4
AT+BAND=4

Documentation Center
Figure 18: Configuring LoRa Parameters
After configuration of the LoRaWAN parameters, the next step is to set up the EUIs and key. You need the use the
values from the TTN console.
Device EUI: 1133557799224466
Application EUI: 1000000000000009
Application Key: 04FA4E626EF5CF227C969601176275C2
Set the Device EUI.
Set the Application EUI.
Set the Application Key.
AT+DEVEUI=1133557799224466
AT+APPEUI=1000000000000009
AT+APPKEY=04FA4E626EF5CF227C969601176275C2

Documentation Center
Figure 19: Configuring LoRa Parameters
After EUI and keys configuration, the device can now join the network and send payloads.
Join command format: AT+JOIN=w:x:y:z
Parameter Description
After 5 or 6 seconds, if the request was successfully received by a LoRa gateway, you should see +EVT:JOINED
status reply as shown on Figure 20.
📝
NOTE:
If the OTAA device failed to join, you need to check if your device is within reach of a working LoRaWAN
gateway that is configured to connect to TTN. It is also important to check that all your OTAA parameters
(DEVEUI, APPEUI and APPKEY) are correct using the AT+DEVEUI=? , AT+APPEUI=? and AT+APPKEY=?
commands. Lastly, ensure that the antenna of your device is properly connected.
After checking all the things above, try to join again.
With the end-device properly activated, you can now try to send some payload after a successful join.
w Join command - 1: joining, 0: stop joining.
x Auto-join config - 1: auto-join on powerup, 0: no auto-join
y Reattempt interval in seconds (7-255) - 8 is default.
z Number of join attempts (0-255) - 0 is default.
AT+JOIN=1:0:10:8

Documentation Center
Send command format: AT+SEND=<port>:<payload>
Figure 20: OTAA Test Sample Data Sent via RAK Serial Port Tool
You can see the data sent by the RAK3172 module on the TTN device console Live data section. Also, the Last
seen info should be a few seconds or minutes ago.
Figure 21: OTAA Test Sample Data Sent Viewed in TTN
TTN 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 to click + Add end device as shown in Figure 22.
AT+SEND=2:12345678

Documentation Center
Figure 22: Adding ABP 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 figures
23 and 24.
Figure 23: Manually register device to TTN

Documentation Center
Figure 24: Selecting ABP and LoRaWAN version
At this step, you need to put a unique End device ID and DevEUI as shown in Figure 25. 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 on 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.

Documentation Center
Figure 25: ABP Device Information
The next step is to set up the Frequency plan, a compatible Regional Parameter version and the LoRaWAN
class supported. In an ABP device, you also need to generate a Device Address and a NwkSKey (Network
Session Key). Then you can click Application layers settings.
Figure 26: ABP Device Configuration

Documentation Center
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 27: ABP AppSKey generation and device registration
You should now be able to see the device on the TTN console after you fully register your device as shown in
Figure 28.
Figure 28: ABP device successfully registered to TTN
ABP Configuration for TTN
To set up the RAK3172 module to join the TTN using ABP, start by connecting the RAK3172 module to the
computer (see Figure 1) and open the RAK Serial Port Tool. Select the right COM port and set baudrate to 9600.
It is recommended to start by testing the serial communication and verify the current configuration is working by
sending these two AT commands:
Table of contents
Other RAK Control Unit manuals

RAK
RAK RAK1901 User manual

RAK
RAK RAK815 User manual

RAK
RAK WisDuo Series User manual

RAK
RAK WisCore-LoRa RAK3401 User manual

RAK
RAK WisTrio LoRa Tracker User manual

RAK
RAK WisBlock RAK19010 User manual

RAK
RAK WisLink-Cellular RAK2011 User manual

RAK
RAK RAK566 User manual

RAK
RAK WisBlock RAK13005 User manual

RAK
RAK WisBlock RAK12004 User manual