RAK7204 Quick Start Guide
Prerequisites
What do you need?
Before going through each and every step in the installation guide of the RAK7204 WisNode Sense Home, make sure to prepare the necessary items listed below:
- RAK7204 WisNode Sense Home
- Micro USB Cable
- Gateway in Range, for Testing
- Windows PC
This device released by RAKwireless is already pre-loaded with its latest firmware upon manufacturing. If you want to have your device's firmware and bootloader burned, please refer to the sections below:
What's Included in the Package?
- 1pc - RAK7204 WisNode Sense Home
- 1pc - LoRa Antenna
- 1pc - 3500 mAh Lithium Battery
Product Configuration
Interfacing with the RAK7204 WisNode Sense Home
In order for you to be able to interface with the RAK7204 WisNode Sense Home with your Windows Machine, you need to download the RAK Serial Port Tool.
The included battery is non rechargeable. Please do note that when configuring the device, you have to connect the battery first in order for it to work.
- Connect your RAK7204 WisNode Sense Home in your Windows Machine using the provided micro-usb cable.
Figure 1: RAK7204 WisNode Sense Home to Laptop ConnectionThe pin distance of the battery connector is 2.0 mm. Reverse connection or short circuit may damage the device and may cause overheating and combustion of the battery. Therefore, when replacing the battery, it is necessary to strictly confirm whether the positive and negative poles of the connector are correct.
- Open the RAK Serial Port Tool :
Figure 1: RAK Serial Port Tool- In choosing the correct COM Port number for your device. Go to your Device Manager by pressing : Windows + R and type
devmgmt.mscor search in the Start Menu
Figure 1: Device Manager- Look for Ports (COM & LPT) and Find the name Silicon Labs CP210x USB to UART Bridge and take note of the COM Port Number.
If you didn't find any Port with the name Silicon Labs CP210x USB to UART Bridge, make sure you have downloaded the CP210x USB Drivers in your Machine.
- Choose the Correct Port Number from the device manager and the Correct Baudrate then click Open:
Figure 1: Correct Port Number and Correct Baud rate
Figure 1: Connection SuccessConnecting to Helium (The People's Network)
Helium has quickly become the most widespread LPWAN communal network with more than 27,000 devices deployed globally. All our node products are compatible with it and the process of adding a device to the network is intuitive and straightforward.
This section will focus on giving a brief guide on how to connect the RAK7204 to the network console, assuming that there is a Helium Hotspot within range.
Log in or create your Helium account.
Figure 1: Helium consoleOnce registered/logged in, you will end up at the home page where you can see your function tree on the left and your DC balance at the tops as well as a number of useful links.
Figure 1: Helium console home screenGo to the Devices section in the function tree. If this is your first time doing this there will be no devices registered. Click the + Add Device button to get started.
Figure 1: Helium devicesA window will pop up with a set of field containing the device parameters required for its registration.
Figure 1: Add a new deviceFill in a name of your choosing. The Dev EUI, App EUI, and App Key will have random values generated for you by default. Press the eye icon to reveal the values. You can manually replace them with values of your own. For this tutorial, use the default values. Press the Submit button, and you are done.
Figure 1: Helium devicesNow your RAK7204 is registered and is awaiting activation. For this to happen, you need to import the Dev EUI, App EUI and App Key in the RAK7204 using the RAK Serial Port Tool.
Open the tool, select the desired port (default baud rate) and open it. Then start importing your settings.
Configure your LoRa band and activation mode. This tutorial will be using the EU868 band and OTAA (only option available for now with Helium) with device class A (default one, does not need configuring).
- Regional band and activation mode setting
at+set_config=lora:join_mode:0
at+set_config=lora:region:EU868
- Enter the Dev UI
Use the command below by replacing the XXXX with your Device EUI from the Helium console:
at+set_config=lora:dev_eui:XXXX
- Enter the App EUI
Same as with the Device EUI, replace the XXXX with your value:
at+set_config=lora:app_eui:XXXX
- Enter App Key
Finally, fill in the App key with the command:
at++set_config=lora:app_key:XXXX
- Join Network
Finish executing the join command in order for the node to initiate the join procedure.
Once the procedure is initiated and successfully complete you will have a notification in the serial console
at+join
You output should resemble the one in Figure 11:
Figure 1: RAK7204 EUIs and keyIf you take a look at the Helium console, you will also see the join request packets both in the graph and event log. Your node is now a part of the Helium Network.
Figure 1: Helium console live device dataConfiguring the Built-in Server
The procedure for connecting the RAK7204 to the Built-in Server is straightforward and includes going through the following steps:
- Open a browser and access the Web UI of your WisGate Edge Gateway by entering its IP address in the browser address bar. You will be greeted by the Log in screen. The default user name/password are both "root".
Figure 1: Built-in Server Log in screenOnce you have logged in make sure you are in Network Server mode. By default the gateway is working in this mode, so if this is the first time you are configuring it it should already be set. If this is nit the case go to the Network Server menu, the Network Settings sub menu and select the Network Server option in the Mode drop-down menu:
Figure 1: Network Server mode- Start the Device registration process by going to the Application sub menu in the LoRa Network section and creating an application. Enter a name in the field, leave the default type and press "Save & Apply"
Figure 1: Creating your applicationIn the following screen you will see fields for the application parameters.
In the Application Configuration sub-window enable the "Auto Add LoRa Device" functionality. Generate a random Application EUI and Application Key via the green arrow button next to the text fields. Note these down as you will need them for the RAK7204 configuration.
Figure 1: Application configurationMove to the Payload Formats sub-window and set the payload format to "CayenneLPP" via the drop down menu. This is the format that the RAK7204 uses, thus enabling this functionality will allow you to see the parsed data in the Application Server. Finally enable the "Only forward the parsed data object" functionality, press the "Save & Apply" button to finalize the configuration changes.
Figure 1: Payload Format- Now that your application has been created you need to go to the device section by pressing the "Edit " button.
Figure 1: Editing an applicationNow you are in the "Devices" section and you can add a device by entering its Device EUI, which you can find on a sticker on the back of the RAK7204. Press the "Add" button to proceed.
Figure 1: Adding a deviceIn the configuration screen enter a name for your device and leave the rest of the parameters with their default values (the Description is optional). Finish by pressing the "Save & Apply" button.
Figure 1: Device parametersYour Device is now added to the Built-in server and you should see it in the "Devices" section.
Figure 1: Devices sectionNext you need to import the same configuration in the RAK7204.
Configuring the RAK7204
Start by connecting to your RAK7204 as described in the Product Configuration section of the Quick Start Guide.
Open a terminal and check your firmware version using the command:
at+version
Figure 1: Firmware versionIf there is a newer firmware version at the link, update using this procedure.
Follow the steps in order to update the RAK7204 configuration and connect it to the Built-in Server
- Import the Device EUI (from the label on the back), Application EUI and Application Key (you should have noted them down as instructed in the previous section), by executing the following commands in order (replace the "xxxx" with your values).
Device EUI
at+set_config=lora:dev_eui:xxxx
Application EUI
at+set_config=lora:app_eui:xxxx
Application Key
at+set_config=lora:app_key:xxxx
Figure 1: Importing EUIs and Key- Set the activation parameters (LoRa Region, Device Class, Activation Mode). This example will use the EU868 regional band, class A, OTAA activation mode.
LoRa Region
at+set_config=lora:region:EU868
Device Class
at+set_config=lora:class:0
Activation Mode
at+set_config=lora:join_mode:0
After executing the last command the node will automatically start the join procedure. If for some reason this is not the case, you can always use the command below to start the activation process:
at+join
Figure 1: Activation parametersUpon successful registration the following response will be shown in the Serial Tool.
Figure 1: Successful Device JoinIf you check the Devices Section and the Live Device Data in the Devices section you should see the device being online for some time and also some packets, in this case the Join request and an uplink packet where the data is visible in a human readable format (as we chose the Cayenne payload format)
Figure 1: Device up-time
Figure 1: Device real time packetsYour RAK7204 is now connected to the Built-in server and transmitting data over regular intervals.
Connecting to The Things Network V3 (TTNv3)
At The Things Conference 2021, it was announced that The Things Network is upgrading to The Things Stack v3.
In this section, it will be shown how to connect RAK7204 WisNode Sense Home to The Things Stack.
First, log in to the TTNv3. To do so, head to the TTNv3 site. If you already have a TTN account, you can use your The Things ID credentials to log in.
Figure 1: The Things Stack Home Page
Figure 1: Console Page after successful login-
To connect RAK7204 WisNode Sense Home to TTNv3, you should already have connected a gateway in range to TTNv2 or TTNv3, or you have to be sure that you are in the range of a public gateway.
-
This tutorial is for EU868 Frequency band.
Adding an Application
- If you do not have created applications yet, to create an application, choose Create an application. If you have created applications before, navigate through Go to applications > + Add application.
Figure 1: Create an application page-
Fill in the needed information:
-
Owner - Automatically filled by The Things Stack, based on your account or created organization.
-
Application ID - This will be the unique ID of your application in the Network. ID must contain only lowercase letters, numbers, and dashes (-).
-
Application name (optional) - This is the name of your application.
-
Description (optional) – Description of your application. Optional application description; can also be used to save notes about the application.
-
Figure 1: Application OverviewOTAA Mode
Register the Device
- From the Application Overview page, click on + Add end device.
Figure 1: Adding a device in OTAA mode- Below the Register end device heading, you can find two options for registering a device. Choose Manually.
- For Activation mode, choose Over the air activation (OTAA)
- For the LoRaWAN version, choose MAC V1.0.2 (RAK7204 is LoRaWAN 1.0.2 fully compliant).
Figure 1: Registering the device in OTAA mode- To get to the next step of the registration, click Start.
Figure 1: Basic settings for OTAA mode-
Fill in the Basic settings for the device:
-
End device ID - This is the unique identifier for your RAK7204 WisNode Sense Home in your application. You need to enter this manually. The End device ID must contain only lowercase letters, numbers, and dashes (-).
-
AppEUI - The AppEUI uniquely identifies the owner of the end device. It is provided by the device manufacturer. To get the AppEUI, connect your device via USB cable to your computer. Open RAK Serial Port Tool, choose the correct COM port and BaudRate, and run the following command:
at+get_config=lora:status -
Figure 1: AppEUI of the device- DevEUI - The unique identifier for this end device. It can be found on a sticker on the back of the device.
- End device name (optional) - A unique, human-readable identifier for your device. You make it up, so be creative. Device IDs cannot be used by multiple devices within the same application.
- End device description (optional) - Optional end device description; can also be used to save notes about the end device.
- Click Network layer setting.
Figure 1: Network layer setting for OTAA mode- Here you must configure the Network layer settings for the device:
-
Frequency plan - The frequency plan used by the end device. Note that, for this tutorial, the frequency plan used is Europe 863-870 MHz (SF9 for RX2 – recommended).
-
Regional Parameters version - The Regional Parameters specify frequency, dwell time, and other communication settings for different geographical areas. The Regional Parameters version is the version of the LoRa Alliance specification which your device supports. This should be provided by the device manufacturer in a datasheet. For this example, PHY V1.0.2 REV B is chosen.
-
LoRaWAN class capabilities – Here you can select if your device supports Class B, Class C, or both.
- In Advanced settings, you can configure additional settings for your device.
Figure 1: Advanced network layer settings of the deviceFor this example, these settings will be left as default.
- Click Join settings.
Figure 1: Join settings for OTAA mode- Fill in the Application key (AppKey) to secure communication between the end device and the application. The AppKey can be generated automatically by clicking the Generate button next to the AppKey field.
Figure 1: Generate the AppKey- In the Advanced settings, you can configure more options about your device.
Figure 1: Advanced join settings for OTAA modeFor this example, these settings will be left as default.
- Finally, to finish registering your device, click Add end device.
Configuring the Device in OTAA Mode
- For configuring the node, you will need the following three parameters: Device EUI, Application EUI, and Application Key. You can see them all on the Device Overview page. But since the two EUI's come with the device, you only need the Application Key from there.
Figure 1: OTAA device parameters- Using the RAK Serial Port Tool, set the join mode, device class, and your LoRaWAN region to your correct frequency band, with the following set of AT commands:
- For the join mode (OTAA):
at+set_config=lora:join_mode:0
- For the class (Class A):
at+set_config=lora:class:0
- For the region:
at+set_config=lora:region:EU868
Remember to replace the frequency band with the one for your LoRaWAN region. Check first your frequency plan.
Figure 1: Setting up the RAK7204 WisNode Sense Home operation modeThe following tutorial is based on using the EU868 frequency band.
- Now that those parameters are set, enter the App Key, using the command below. Remember to replace the "XXXX" with the corresponding parameter value for your particular case.
at+set_config=lora:app_key:XXXX
Figure 1: Setting up the RAK7204 WisNode Sense Home OTAA parameters- Finally, execute the join command:
at+join
Figure 1: Join commandIf you get a response in the Live data feed in The Things Stack, it means your RAK7204 is successfully connected!
Figure 1: Sending data to The Things Stack from RAK7204 WisNode Sense HomeConnecting to ChirpStack
The ChirpStack or previously known as LoRaServer project provides open-source components for building LoRaWAN networks. Learn more about ChirpStack.
You can use RAK7204 WisNode Sense Home to connect with ChirpStack according to the following steps:
In this section, it is assumed that you are using RAK Gateway and its built-in ChirpStack or RAK cloud testing ChirpStack. It is also assumed that a Gateway with the ChirpStack has been configured successfully. If not, please have a look at RAK's documents for more details about RAK LPWAN Gateway and RAK cloud testing.
- Open the web page of the ChirpStack which you want to connect with and login.
- By default, there is already one or more items in this page, you can use it or create a new item. Now, let’s create a new item by clicking the “CREATE” button, then filling them in.
Figure 1: ChirpStack Applications- Fill up the necessary information then Click "CREATE APPLICATION”.
Figure 1: Creating the Application- Click the new item name “RAKwireless_Test_Application”:
Figure 1: Applications page in ChirpStack
Figure 1: RAKwireless Test Application- Add a Node device into ChirpStack by clicking the “CREATE” button:
Figure 1: Adding a Node Device- Fill them in. You can generate a Device EUI automatically by clicking the Device EUI icon, or you can write the correct Device EUI in the edit box.
Figure 1: Filling the Device ParametersIf you want to join in OTAA mode, select “DeviceProfile_OTAA” in the “Device-profile” item. If you want to join in ABP mode and CN470 frequency, then, select “DeviceProfile_ABP_CN470” in the “Device-Profile” item. If you want to join in ABP mode and other frequencies except AS923 and CN470, you should select “DeviceProfile_ABP” in the “Device-profile” item.
OTAA Mode
- To join ChirpStack in OTAA mode, select “DeviceProfile_OTAA”.
Figure 1: Selecting OTAA Activation Mode in ChirpStack- Press “CREATE DEVICE” button. You may write the application key by yourself or generate it automatically by clicking the icon highlighted in the image.
Figure 1: Application Key Generation- Click "SET DEVICE KEYS” button. Now, you’ve completed the configuration on ChirpStack.
- The Device EUI which was set in the previous section to your RAK7204 WisNode Sense Home as "dev_eui" is the same in the image highlighted below.
Figure 1: Device EUI Code- Same with the Application Key, which was set in the previous section as "app_key" is the same with the image highlighted.
Figure 1: Application Key LoRaWANThe Application EUI which was into RAK7204 WisNode Sense Home as “app_eui” is not needed for ChirpStack.
- Next, let’s configure RAK7204 WisNode Sense Home by using AT commands. To do this, connect your RAK7204 WisNode Sense Home to a PC, power it on and open RAK Serial Port Tool on your computer.
at+version
Figure 1: RAK Serial Port Tool- Now, let us join our RAK7204 WisNode Sense Home using the OTAA activation mode.
- If the join mode is not in OTAA, just set the LoRa join mode to OTAA and LoRa class to Class A by typing the AT commands shown in the picture below.
at+set_config=lora:join_mode:0
at+set_config-lora:class:0
Figure 1: Setting of LoRaWAN mode and class- Type the following AT command to set the: Frequency/Region, Device EUI, Application EUI and Application Key. Remember to replace the "XXXX" with the corresponding parameter value for your particular case:
at+set_config=lora:region:XXXX
at+set_config=lora:dev_eui:XXXX
at+set_config=lora:app_eui:XXXX
at+set_config=lora:app_key:XXXX
Figure 1: Setting of Frequency and Device EUI
Figure 1: Setting of Application EUI and Key- Then, join in OTAA mode.
at+join
Figure 1: Joining in OTAA- Joined Successfully!