Skip to main content

RAK7201V2 WisNode Button 4K Quick Start Guide

Prerequisites

Before going through each and every step in the installation guide of the RAK7201V2 WisNode Button, make sure to prepare the necessary items listed below:

  1. RAK7201V2 WisNode Button 4K
  2. Micro USB cable
  3. A gateway in range
  4. Windows PC

Package Inclusion

  • 1 pc RAK7201V2 WisNode Button 4K
  • 1 pc Micro USB cable
  • 1 pc Sticker for attaching the button to a flat surface

Product Configuration

Interfacing With the RAK7201V2 WisNode Button 4K

For you to be able to interface with the RAK7201V2 WisNode Button 4K with your Windows machine, you need to download the RAK Serial Port Tool.

  1. Connect your RAK7201V2 WisNode Button 4K to your Windows machine using the provided Micro USB cable.
Figure 11725: RAK7201V2 WisNode Button 4k to laptop connection
  1. Open the RAK Serial Port Tool.
Figure 11726: RAK Serial Port Tool
  1. To choose the correct COM Port number for your device, go to your Device Manager by pressing the Windows key + R and type devmgmt.msc. You can also search for the Device Manager in the Start menu.
  2. Once opened, look for Ports (COM & LPT) and find the name USB-SERIAL CH340. The COM Port Number differs, and in this guide, it is COM4.
Figure 11727: Device Manager
  1. Choose the correct COM port number from the device manager and the correct baud rate, then click Open. The default baud rate of the WisNode Button 4K is 115200 bps.
Figure 11728: Correct COM port and baud rate are chosen
  1. To check if the latest firmware version is in use, send the AT+VER=? command. If your device is not running the latest firmware, you need to upgrade it, following the Firmware Upgrade Guide.
Figure 11729: Checking the firmware version

Connecting to the Built-In Network Server

This section provides instructions on how to connect the RAK WisNode Button 4K to the built-in server that is part of all RAK WisGate Series gateways.

You can find more information about RAK's Edge gateways and how to use the built-in server here:

NOTE

The following guide showcases the Web UI of WisGateOS 2 which is run by WisGate Edge Version 2 gateways.

Creating an Application

  1. Login into the gateway via the Web UI and select the Application tab in the LoRa menu.
Figure 11730: Application menu in the web UI of the gateway
  1. Click the Add application button and fill out the Application name. Select Unified Application key as Application Type and use the Autogenerate button to generate an Application Key and Application EUI.
Figure 11731: Creating an application

Adding the Device to the Application

  1. In the created application, click on the End device tab and then the Add end device button.
Figure 11732: Application edit
  1. Fill out the End device name and the LoRaWAN MAC Version (V1.0.3 is the correct one for RAK7201V2). Click on the Add end devices.
Figure 11733: Adding the device
  1. Input the End Device EUI of your device and then click Add to "End Devices list".
Figure 11734: Configuring the device's setings
  1. You will see the device in the End devices list and the Add end devices button will allow you to register your end device in the application.
Figure 11735: The device is registered

Configuring the Button in OTAA Mode

  1. To manage to connect the Button to the Built-In Server in the gateway, a configuration with the correct parameters is needed. Using the AT commands and the RAK Serial Port Tool, the following parameters must be set:
  • Join Mode (OTAA)
AT+NJM=1
  • Region (EU868 for this example)
AT+BAND=2
  • Device EUI (on the sticker at the back of the device)
AT+DEVEUI=ac1f09fffexxxxxx
  • Application EUI (from the application configuration created previously in the gateway)
AT+APPEUI=bf3112d69fxxxxxx
  • Application Key (from the application configuration created previously in the gateway)
AT+APPKEY=ea980d6f2e42772550c66ec265xxxxxx
Figure 11736: Configuring RAK7201V2 in OTAA mode
NOTE

The Keys and EUIs shown here are just examples, use the ones generated by your system or corresponding to your device.

  1. To connect to the LoRaWAN Network after the configuration, the device must be restarted. The restart command is as follows:
ATZ
  1. After the restart, you need to issue AT+JOIN to join the LoRaWAN network. If all the settings are configured correctly, an +EVT:JOINED message will be displayed in the RAK Serial Port Tool.
Figure 11737: The device has restarted and connected to the LoRaWAN Network
  1. After the successful connection, the data obtained from pressing the buttons will be transmitted to the application server of the gateway.
Figure 11738: Successful operation of the buttons
  1. The received data from RAK7201V2 can be seen in the web UI of the gateway under Application > Device > Live Device Data.
Figure 11739: Received data

Configuring the Button in ABP Mode

To use the RAK7201V2 in ABP mode, a change of the activation method is needed.

  1. Go to the Device Configuration in the gateway, and select the ABP Join mode.
Figure 11740: Changing the activation method
  1. The following fields appear: Device Address, Application Session Key, and Network Session Key. Enter the Device Address manually, and it should be in HEX format and 8 digits long.
  2. To generate the needed keys automatically, click the Autogenerate button next to the Application Session key and Network Session Key fields. Click Save & Apply.
Figure 11741: Changing the activation method
  1. To set the RAK7201V2 in ABP work mode, the following AT commands must be executed in the RAK Serial Port Tool:
  • Join mode (ABP)
AT+NJM=0
  • Device Address (from the device configuration created previously in the gateway)
AT+DEVADDR=00000001
  • Application Session Key (from the device configuration created previously in the gateway)
AT+APPSKEY=bfb959106b004e5a32d8dde9fexxxxxx
  • Network Session Key (from the device configuration created previously in the gateway)
AT+NWKSKEY=0a8139122e9e9011c049bcc575xxxxxx
Figure 11742: Configure the RAK7201V2 in ABP mode
NOTE

The Keys and EUIs shown are just examples. Use the ones generated by your system or corresponding to your device.

  1. To connect to the LoRaWAN Network after the configuration, the device must be restarted. The restart command is as follows:
ATZ
  1. After the restart, the device will be ready to send the information through the LoRaWAN Network.
Figure 11743: Configure the RAK7201V2 in ABP mode
NOTE

There is no Join procedure in ABP mode. To be sure that the Button can send data, you need to press the buttons and see if you have uplinks in the Live Device Data field of the device in the gateway.

  1. To test the ABP mode, press the buttons of the device.
Figure 11744: Testing the ABP mode
  1. The received data from RAK7201V2 can be seen in the web UI of the gateway under Application > Device > Live Device Data.
Figure 11745: Received data

Customize the Data Sent

This section addresses the main functionality of the different keys (buttons) of the device.

The default payload data of the keys:

KeyData
Key 1A
Key 2B
Key 3C
Key 4D

To customize the data sent by every button, follow the AT command:

AT+BUTTON=<button>:<port>:<data>

Where:

  • <button>: the configured key (range 1-4)

  • <port>: the configured port number (range 1-223)

  • <data>: the sent data (max length is 10 characters)

Example:

Change the data sent from the pressing of button 1 to HelloWorld using the command:

AT+BUTTON=1:1:HelloWorld
NOTE

Refer to the datasheet to view the key functions of the button.

After the button is pressed, if the device is still sending, the user's subsequent key actions will be ignored until the device has finished sending.

LEDs Functions

Refer to the datasheet to view the key functions of the button.

HeartBeat Functions

The HeartBeat is used to monitor the network connection and to send the battery level information of the RAK7201V2.

The device can send a HeartBeat packet according to the configured HeartBeat interval. The AT command for configuring the HeartBeat interval is as follows:

AT+HEARTBEAT=<interval>

Where:

  • The interval range is 0-120 (in hours), 0 to turn off the function.

Example:

Set the HeartBeat to one hour using the command:

AT+HEARTBEAT=1
Figure 11746: Set the HeartBeat interval

The HeartBeat message data format is as follows:

HeadersPayload
0X48Battery level in HEX

The battery level is represented in percentage form in hexadecimal format.

Example:

If the payload message of the HeartBeat is 48 61, it represents 96% battery level.

Figure 11747: HeartBeat message in the Live Device Data

The device will automatically send a low-voltage alarm signal when the battery power is below 20% and again when it is below 10%.

Battery power warning signal:

Battery PowerWarning Signal
Power is less than 20%.57 14
Power is less than 10%.57 0a

Device Restart

Two restart options are available:

  1. Using an AT command:
ATZ
Figure 11748: Restarting with an AT command
  1. Hold Key 2 for three (3) seconds. When held, the blue LED will stay lit. It will turn off when the device is restarted.
NOTE

After restarting the device either manually or through the AT command, the RAK7201V2 will attempt to automatically join the network if the OTAA method is configured. You can identify this process through the four blue LEDs that will flash clockwise.

The device will make three attempts to join the network. If the first three attempts fail, the red LED on button 4 will flash for a second. If all three attempts are unsuccessful, the device must be restarted either manually or through the AT command to make a new attempt.