RAK5205 WisTrio LPWAN Tracker Quick Start Guide
Prerequisites
Before going through each and every step in the installation guide of the RAK5205 WisTrio LPWAN Tracker, make sure to prepare the necessary items listed below:
- RAK5205 WisTrio LPWAN Tracker
- Micro USB Cable
- Gateway in Range for Testing
- Windows PC
Package Inclusions
- 1pc - RAK5205 WisTrio LPWAN Tracker
- 1pc - Micro USB Cable
- 1pc - LoRa Antenna
- 1pc - GPS Antenna
- 1pc - Battery connector cable (JST) - requires soldering
- 5pcs - Jumper Caps
- Male to Female Jumper Wires
Product Configuration
Interfacing with the RAK5205 WisTrio LPWAN Tracker
To interface with the RAK5205 WisTrio LPWAN Tracker with your Windows PC, you need to download the RAK Serial Port Tool.
Before powering the RAK5205, you should install the LoRa and GPS antenna first. Not doing so might damage the board.
Use Figure 1 as a reference to connect the antennas.
- Connect your RAK5205 WisTrio LPWAN Tracker to your Windows PC using the provided micro-usb cable.
- Open the RAK Serial Port Tool.
Figure 1: RAK Serial Port Tool- To setup the correct COM Port number for your device, go to Device Manager by pressing Windows + R and type devmgmt.msc. Or, search for devmgmt.msc 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 can't find any port with the name Silicon Labs CP210X, make sure you have installed the CP210X Drivers on your Windows PC.
- Choose the correct port number and baud rate from the device manager, then click Open.
Figure 1: Correct COM Port and BaudrateConnecting to The Things Network (TTN)
In this section, you will be connecting the RAK5205 WisTrio LPWAN Tracker to The Things Network (TTN). If you don't have an account yet, head on to TTN website and create one. Once done, log in to your account and go to the console.
Figure 1: The Things Network Home Page
Figure 1: TTN Console Page- Choose "APPLICATIONS".
Figure 1: Application PageAdding An Application
- Click the "add application" button.
Figure 1: Adding an ApplicationHere 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 characters should be in lower case, and 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 - handler you want to register this application to.
- 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 Figure 9, then this means that you have successfully registered your application.
Figure 1: Application OverviewRegister Device
- Scroll down until you see the Devices section, or you can also click the "Devices" button at the top.
Figure 1: Device Section- Click "Register device".
Figure 1: Add your DeviceHere are the things that you should take note of in registering your device:
- Device ID - this is the unique identifier for your RAK5205 WisTrio LPWAN Tracker in your application. You need to enter this manually.
- Device EUI - Device EUI of RAK5205 can be found on the sticker label of the RAK811 module. This will ensure you have a unique identification across LoRaWAN networks. You can still change it later, if you want.
The App Key should be in auto generation mode by default.
- Lastly, click the Register button. Now, your device is registered under the corresponding application.
Figure 1: Device OverviewDepending on which authentication method you want to use, proceed to either the OTAA mode or ABP mode section.
OTAA Mode
When setting up a new device in TTN, its default mode is OTAA or Over-the-Air Activation. For configuration, you need the following three parameters: Device EUI, Application EUI, and App Key. You can get them all from the Device Overview page.
Figure 1: Device OTAA ParametersNow, configure the RAK5205 to work in OTAA mode in the EU868 band, as an example.
The default LoRa working mode for the RAK5205 is LoRaWAN 1.0.2, while the default LoRa join mode is OTAA, and the default LoRa class is Class A.
- Set mode to OTAA, device class to Class A and your LoRaWAN region to your correct frequency band, with the following set of commands below. Remember to replace XXX with your LoRaWAN region. Refer to RAK5205 Datasheet for your frequency plan.
at+set_config=lora:join_mode:0
at+set_config=lora:class:0
at+set_config=lora:region:XXX
RAK5205 will be sleeping most of the time. You need to input again the command if the reply you get is Wake up.
- Now that RAK5205 is configured to be activated via OTAA, enter these parameters: Device EUI, Application EUI, and App Key using the commands below. Remember to replace the "XXXX" with the corresponding parameter value that matches the LoRaWAN network server.
at+set_config=lora:dev_eui:XXXX
at+set_config=lora:app_eui:XXXX
at+set_config=lora:app_key:XXXX
Figure 1: Setting up the RAK5205 OTAA parametersYou should end up with a window like the one in Figure 14 with a series of OK replies.
- Finally, execute the join command. If you join successfully, you will see that the device will start to search for satellite signal.
at+join
Figure 1: Join command- After the successful join, the device will automatically send uplinks that contains the sensor readings. This will take a while so you have to wait. If you do not see any transmissions, you can set the time interval via AT command. Also, if you are working indoors on your first setup, you will not see the GPS coordinates on the payload. The GPS needs to fix first.
Figure 1: Sending an uplink frame- If everything works ok, you will get a response in your TTN live data feed as shown in Figure 17.
Be sure that the TTN console is open before sending the data through the RAK Serial Port. Else, you will not be able to see the packet sent.
Figure 1: Sending Data to TTN from RAK5205ABP Mode
-
To join the ABP mode, go to device settings and switch the activation method to ABP.
-
By default, the Device Address, Network Session Key, and App Session Key will be generated automatically.
Figure 1: Switching to ABP mode- Save the mode change and return to the Device Overview page. You can copy the keys by pressing the button after the value fields marked in red in Figure 19.
Figure 1: ABP parameters screen- Set mode to ABP and device class to Class A, respectively. For the LoRaWAN region, set it according to your frequency plan, which can be found in the Datasheet. Replace the XXX with the correct LoRaWAN region. You should end up with a series of OK replies as shown in Figure 20.
at+set_config=lora:join_mode:1
at+set_config=lora:class:0
at+set_config=lora:region:XXX
Figure 1: ABP parameters screen- Now that the mode has been changed, enter the parameters listed which are needed for ABP activation: Device Address, Network Session Key, and Application Session Key. Remember to replace the "XXXX" with the corresponding parameter value that matches the LoRaWAN network server. Refer to Figure 19 for the parameters.
at+set_config=lora:dev_addr:XXXX
at+set_config=lora:nwks_key:XXXX
at+set_config=lora:apps_key:XXXX
- Finally, execute the join command:
at+join
Figure 1: Join command- After the successful join, the device will automatically send uplinks that contains the sensor readings. This will take a while so you have to wait. If you do not see any transmissions, you can set the time interval via AT command. Also, if you are working indoor on your first setup, you will not see the GPS coordinates on the payload. The GPS needs to be fixed first.
Figure 1: Sending an uplink frameIf you get the same response in your TTN live data feed as shown in Figure 23, then you are all set.
Figure 1: Sending Data to TTN from RAK5205Connecting to ChirpStack
The ChirpStack or previously known as LoRaServer project provides open-source components for building LoRaWAN networks. To learn more about ChirpStack, visit their website.
You can use RAK5205 to connect with ChirpStack according to the following steps:
In this section, it is assumed that you have already connected your gateway to ChirpStack correctly. If not, look into the RAK Documentation Center of your RAK Gateway in hand.
-
Open the web page of the ChirpStack which you want to connect with and login.
-
By default, there are already one or more items on this page. You can either use it or create a new item, but for this, create a new item by clicking the “CREATE” button.
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 LoRa node device into ChirpStack by clicking the “+ CREATE” button.
Figure 1: Adding a Node Device- Fill them in. The Device EUI of RAK5205 can be found on the sticker label of the RAK811 module. Use this to ensure that you have a unique identification across LoRaWAN networks. You can also generate a random Device EUI automatically by clicking the Device EUI icon.
Figure 1: Filling the Device Parameters- If you want to join in OTAA mode, select “device_profile_otaa” in the “Device-profile” item.
- If you want to join in ABP mode and CN470 frequency, select “DeviceProfile_ABP_CN470” in the “Device-Profile” item.
- If you want to join in ABP mode and other frequencies except for AS923 and CN470, select “device_profile_abp” in the “Device-profile” item.
OTAA Mode
- To join ChirpStack in OTAA mode, select “device_profile_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 Figure 31.
Figure 1: Application Key Generation- The generated Application Key (App Key) is highlighted in Figure 32.
Figure 1: Application Key LoRaWANThe Application EUI which is set into RAK5205 via AT Command as “app_eui” is not needed for ChirpStack.
-
Click "SET DEVICE-KEYS” button. Now, you’ve completed the configuration on ChirpStack.
-
You should now configure the device via AT commands. Set mode to OTAA, device class to Class A, and your LoRaWAN region to your correct frequency band, with the following set of commands below. Remember to replace XXX with your LoRaWAN region. Refer to RAK5205 Datasheet for your frequency plan.
at+set_config=lora:join_mode:0
at+set_config=lora:class:0
at+set_config=lora:region:XXX
RAK5205 will be sleeping most of the time. You need to input again the command if the reply you get is Wake up.
- Now that RAK5205 is configured to be activated via OTAA, enter these parameters: Device EUI, App EUI, and App Key using the commands below. Remember to replace the XXXX with the corresponding parameter value that matches the Chirpstack network server. You can use the same dev_eui and app_eui when connecting to Chirpstack.
at+set_config=lora:dev_eui:XXXX
at+set_config=lora:app_eui:XXXX
at+set_config=lora:app_key:XXXX
Figure 1: Setting up the RAK5205 OTAA parametersYou should end up with a window like the one in Figure 33 with a series of OK replies.
- Finally, execute the join command.
at+join
Figure 1: Join command- You can view the "JoinRequest" and "JoinAccept" on ChirpStack console. The sensor data will be automatically sent in a programmed interval after a successful join. If you do not see any transmissions, you can set the time interval via AT command. Also, if you are working indoor on your first setup, you will not see the GPS coordinates on the payload. The GPS needs to be fixed first.
Figure 1: Join Request of the Device in the ChirpStackABP Mode
- If you select “device_profile_abp” or “device_profile_abp_cn470”, it means you want to join ChirpStack in “ABP mode”. Fill the parameters “Device name” and “Device description” then click on “CREATE DEVICE” button.
Frequency AS923 in ABP Mode is not supported in Chirpstack.
Figure 1: Chirpstack ABP Activation- Then, you can see that there are some parameters for ABP in the “ACTIVATION” tab.
Figure 1: Chirpstack ABP Activation Parameters Needed- Now that RAK5205 is configured to be activated via ABP, the next step is to setup the device. Set mode to ABP, device class to Class A, and your LoRaWAN region to your correct frequency band, with the following set of commands below. Remember to replace XXX with the your LoRaWAN region. Refer to RAK5205 Datasheet for your frequency plan.
at+set_config=lora:join_mode:1
at+set_config=lora:class:0
at+set_config=lora:region:XXX
Figure 1: ABP parameters screen- Now that the mode has been changed, enter the parameters listed below which are needed for ABP activation: Device Address, Network Session Key, and Application Session Key. Remember to replace the "XXXX" with the corresponding parameter value that matches the LoRaWAN network server. Refer to Figure 37 for the parameters.
at+set_config=lora:dev_addr:XXXX
at+set_config=lora:nwks_key:XXXX
at+set_config=lora:apps_key:XXXX
- Finally, execute the join command. After a successful join, the sensor data will be automatically sent in a programmed interval. If you do not see any transmissions, you can set the time interval via AT command. Also, if you are working indoor on your first setup, you will not see the GPS coordinates on the payload. The GPS needs to be fixed first.
at+join
Figure 1: Join commandConfiguration of GPS and Sensor Data
Transmit Interval
With your RAK5205 already connected to the network server, you can set the interval of sending GPS coordinates and sensor data using the following command:
at+set_config=lora:send_interval:1:Y
- where Y represents the time interval is seconds.
GPS Satellite Scan Time and Accuracy
The GPS module will try to get a fix from GPS satellites to get the location coordinates. You can modify the satellite scan time of RAK5205. In addition, you can also set the accuracy of GPS coordinates to 4-digit or 6-digit decimal places.
To set the GPS satellite scan time where X is in seconds:
at+set_config=device:gps_timeout:X
To set the GPS accuracy to 4-digit if X is 0 and 6-digit if X is 1:
at+set_config=device:gps_format:X
Decoding Sensor Data on ChirpStack and TTN
Analyzing Sensor Data from RAK5205
In the previous section, you have successfully sent some raw data from our RAK5205 LPWAN Tracker to The Things Network, but the problem is that you can't really see the actual sensor data from the payload. In this section, you will solve that and understand what each payload means.
Depending on the GPS coordinates accuracy configured on RAK5205 (either 4-digit or 6-digit), you must use the right decoder that can be downloaded on the RAKwireless Github repository.
Take the payload data in Figure 40, for example.
Payload: 01 88 05 37 97 10 9D 59 00 DC 14 08 02 01 7A 07 68 58 06 73 25 6D 02 67 01 1D 04 02 14 AF 03 71 FF FF FF DD FC 2E
Figure 1: Sample PayloadNow, analyze each piece of data that is in Hexadecimal Format. You will be using the data mentioned above as an example and convert the Hexadecimal Data into Decimal Data using a converter to understand it.
Figure 1: Hexadecimal to Decimal converter1. GPS Data
Example data: 01 88 05 37 97 10 9D 59 00 DC 14
| Parameter | Hex Data | Decimal Equivalent | Multiplier | True Value |
|---|---|---|---|---|
| Data Flag | 01 88 | |||
| Latitude | 05 37 97 | 341911 | 0.0001° Signed MSB | 34.1911° |
| Longitude | 10 9D 59 | 1088857 | 0.0001° Signed MSB | 108.8857° |
| Altitude | 00 DC 14 | 56340 | 0.01 m Signed MSB | 563.4 m |
2. Battery Voltage
Example Data: 08 02 01 7A
| Parameter | Hex Data | Decimal Equivalent | Multiplier | True Value |
|---|---|---|---|---|
| Data Flag | 08 02 | |||
| Battery Voltage | 01 7A | 378 | 0.01 Signed | 3.78 V |
3. Humidity
Example Data: 07 68 58
| Parameter | Hex Data | Decimal Equivalent | Multiplier | True Value |
|---|---|---|---|---|
| Data Flag | 07 68 | |||
| Humidity | 58 | 88 | 0.5% Unsigned | 44.0% RH |
4. Pressure
Example Data: 06 73 25 6D
| Parameter | Hex Data | Decimal Equivalent | Multiplier | True Value |
|---|---|---|---|---|
| Data Flag | 06 73 | |||
| Pressure | 25 6D | 9581 | 0.1 hPa Unsigned MSB | 958.1 hPa |
5. Temperature
Example Data: 02 67 01 1D
| Parameter | Hex Data | Decimal Equivalent | Multiplier | True Value |
|---|---|---|---|---|
| Data Flag | 02 67 | |||
| Temperature | 01 1D | 285 | 0.1 °C Signed MSB | 28.5 ℃ |
6. Gas Resistance
Example Data: 04 02 14 AF
| Parameter | Hex Data | Decimal Equivalent | Multiplier | True Value |
|---|---|---|---|---|
| Data Flag | 04 02 | |||
| Gas Resistance | 14 AF | 5295 | 0.01 kΩ Signed | 52.95 kΩ |