This application note describes IoT Cloud connectivity solution and introduces you how to visualize sensor
data transmitted by the RL78 IoT Node to the Cloud (AWS/Azure/GCP/Cayenne) via LoRaWAN® networks.
The LoRaWAN is a Low Power, Wide Area (LPWA) networking protocol designed to wirelessly connect
battery operated ‘things’ to the internet, and targets key IoT requirements such as end-to-end security.
The application example provided in the demo package uses Kerlink LoRaWAN Gateway, Loriot LoRaWAN
Network Server, Cloud. This document shows the basic steps how to configure these services.
Target Device
RL78/G14(R5F104ML), SEMTECH SX1261/SX1262
Required Resources
Hardware
• Renesas RL78/G14 Fast Prototyping Board (RTK5RLG140C00000BJ)
• Pmod
• Renesas HS3001 Humidity and Temperature Sensor Module with I2C Interface
• Kerlink iFemtoCell (LoRaWAN Gateway)
Software & Development Tools
• LoRaWAN IoT Demo Package V2.20
• e
TM
LoRa® Modem (SEMTECH SX1261/SX1262) with UART Interface
2
studio V7.7.0 / CS+ for CC V8.03.00 with CC-RL V1.09
R11AN0412EJ0220 Rev.2.20 Page 1 of 27
Jan 22, 2021
LoRaWAN® IoT Demo LPWA IoT Solution with Cloud
Contents
1. Getting started ........................................................................................................................... 3
1.2 How to setup the Boards ......................................................................................................................... 4
1.3 How to setup the Demo Firmware ........................................................................................................... 5
2.1 How to setup Kerlink LoRaWAN Gateway .............................................................................................. 7
3. LoRaWAN Network Server ........................................................................................................ 8
3.1 How to setup the Loriot LoRaWAN Network Server ............................................................................... 8
4. Cayenne Cloud Server ............................................................................................................ 10
4.1 How to setup Cayenne Cloud Server .................................................................................................... 10
5. Azure Cloud Server ................................................................................................................. 11
5.1 How to setup Azure Cloud Server ......................................................................................................... 11
5.2 How to setup Azure IoT Hub and Event Hub ........................................................................................ 12
5.3 How to setup Azure Function App (Demo Application) ......................................................................... 13
5.4 How to setup Azure Time Series Insight Gen2 ..................................................................................... 14
6. AWS Cloud Server .................................................................................................................. 16
6.1 How to setup AWS Cloud Server .......................................................................................................... 16
6.2 How to setup AWS IoT Core ................................................................................................................. 17
6.3 How to setup AWS Lambda (Demo Application) .................................................................................. 18
6.4 How to setup Amazon Timestream ....................................................................................................... 19
6.5 How to setup Amazon QuickSight ......................................................................................................... 20
6.6 How to setup Grafana ........................................................................................................................... 21
7. GCP Cloud Server ................................................................................................................... 22
7.1 How to setup GCP Cloud Server ........................................................................................................... 22
7.2 How to create a new project .................................................................................................................. 22
7.3 How to setup GCP Cloud IoT Core ....................................................................................................... 23
7.4 How to setup GCP Pub/Sub .................................................................................................................. 23
7.5 How to setup GCP Cloud Functions ..................................................................................................... 24
7.6 How to setup GCP BigQuery ................................................................................................................. 24
7.7 How to setup Data Studio (Google Data Portal) ................................................................................... 26
Revision History .............................................................................................................................. 27
R11AN0412EJ0220 Rev.2.20 Page 2 of 27
Jan 22, 2021
LoRaWAN® IoT Demo LPWA IoT Solution with Cloud
USB
e2 studio/ CS+
Kerlink
HS3001
Loriot
AWS
Cayenne
RL78/G14
Fast Prototyping Board
LoRaWAN®
Modem
LoRaWAN
Dashboard
Network
Server
Sensor Node
Cloud
Gateway
1. Getting started
1.1 Demo Overview
Azure
GCP
Humidity and
Temperature
Sensor
iFemtoCell
IoT demo firmware running on RL78/G14 sends the sensor data to the LoRa modem periodically. The LoRa
modem transmits the sensor data with LoRaWAN. The LoRaWAN Gateway (Kerlink iFemtocell) forwards the
received LoRaWAN packets to the LoRaWAN Network Server (Loriot). The Loriot publishes the sensor data
to the Cloud server (AWS/Azure/Cayenne).
In case of Cayenne, the sensor data received Loriot network server is directly forwarded to the Cayenne
because the demo sensor data format is based on the Cayenne LPP (Low Power Payload) 2.0.
In case of Azure, the sensor data (Cayenne LPP format) received by Azure IoT Hub is converted to the
JSON by the demo Function App (C# scripts). To analyze and visualize the sensor data, demo Function App
sends the sensor data to the Azure Time Series Insight Gen2 via Azure Event Hub.
In case of AWS, the sensor data (Cayenne LPP format) received by AWS IoT Core is converted to the JSON
by the domo Lambda Function (Python scripts). The demo Lambda Function stores the senor data to the
Amazon Timestream database. You can visualize the sensor data accessing the timestream database with
Amazon QuickSight or Grafana.
In case of GCP (Google Cloud Platform), the sensor data (Cayenne LPP format) received by Cloud IoT Core
is automatically stored in the Pub/Sub. The domo Cloud Function (Node.js scripts) gets the sensor data from
Pub/Sub and sends the decoded sensor data to the BigQuery. You can visualize the sensor data accessing
the BigQuery with Data Studio (Google Data Portal).
R11AN0412EJ0220 Rev.2.20 Page 3 of 27
Jan 22, 2021
LoRaWAN® IoT Demo LPWA IoT Solution with Cloud
PMOD2 (for Sesnsor)
PMOD1 (for LoRaWAN Modem)
Pin
Function
Pin
Function
Pin
Function
Pin
Function
1
N.C
7
N.C
1
N.C.
7
N.C.
2
N.C.
8
N.C
2
TXD (UART)
8
RESETB
3
SCL (I2C)
9
N.C
3
RXD (UART)
9
N.C.
4
SDA (I2C)
10
N.C
4
N.C.
10
N.C.
5
GND
11
GND
5
GND
11
GND
6
VCC (3.3V)
12
VCC (3.3V)
6
VCC (3.3V)
12
VCC (3.3V)
RL78/G14 Fast Prototyping Board
LoRaWAN Modem
on MB-RL1261-06
HS3001 Humidity and
Temperature Sensor
PMOD2
PMOD1
1.2 How to setup the Boards
IoT Demo Board consists of RL78/G14 Fast Prototyping Board, Sensors and LoRa Modem as follows.
PMOD2 and PMOD1 interface configurations.
NOTE1: UART interface is 8bit Non-parity 1stop-bit at 115200bps.
NOTE2: LoRaWAN Modem software on MB-RL1261-06 is based on the LoRaWAN Sample Software
released in “LoRa®-based Wireless Software Package (V2.20)” and ported for the MB-RL1261-06 module.
However, this software is not included in the release package. Please contact the Renesas, if you need.
You can use another RL78/G14 Fast Prototyping Board with SX126x shield instead of the MB-RL1261-06.
NOTE3: The use of wireless receivers and transmitters is restricted by international standards and domestic
regulations. Wireless receivers and transmitters must therefore be used in accordance with the applicable
laws and regulations of the country in which they are being used.
R11AN0412EJ0220 Rev.2.20 Page 4 of 27
Jan 22, 2021
LoRaWAN® IoT Demo LPWA IoT Solution with Cloud
1.3 How to setup the Demo Firmware
Demo firmware located following directory is designed for the RL78/G14 Fast Prototyping Board.
How to use Demo firmware.
STEP1: Connect the RL78/G14 Fast Prototyping Board with USB cable.
STEP2: Copy the demo firmware folder named “rilot2_node” to a temporary directory (e.g. c\Temp).
2
STEP3: Build and run the demo firmware using IDE(e
After importing the project folder, click button > click button > click button twice.
[ CS+ ]
Open or double click the project file located “c:\Temp\rliot2_node\rliot2_node.mtpj”
After loading the project file, click button > click button.
[ Renesas Flash Programmer (V3.05 or later) ]
File > New Project … > Fill in all field as below > Click “Connect”
Microcontroller : RL78, Project Name and Folder : any , Tool : E2 emulator Lite, Wide Voltage : Not check
Click “Browse” and select “c:\Temp\rliot2_node\rliot2_node.mot” as Program File > Click “Start”
R11AN0412EJ0220 Rev.2.20 Page 5 of 27
Jan 22, 2021
LoRaWAN® IoT Demo LPWA IoT Solution with Cloud
Field
Description
Byte
Type
Unit
Remark
CH01
Channel 01 as humidity
2
UInt16
n/a
Fixed
HUMI
Current humidity value
1
UInt8
0.5%
0x5D(93) * 0.5 = 46.5 [%]
CH02
Channel 02 as temperature
2
UInt16
n/a
Fixed
TEMP
Current temperature value
2
Int16
0.1°C
0x00F9(249) * 0.1 = 24.9 [°C]
AT+SENDHEX=”01685D026700F9”
CH01 HUMI CH02 TEMP
By default, demo firmware will send sensor data, 1000 times at 60000 [ms] intervals. These parameters can
be changed to modify following macro definition described in “src\apps\rliot2_node.h”.
LoRaWAN device configuration (Region, DevEUI, Keys) can be changed in the “src\apps\rliot2_node.c”.
Demo firmware will send a sensor data with following Cayenne LPP format using AT-Command.
NOTE1: Cayenne will recognize any payload based on the Cayenne LPP format. The demo function on the
AWS and Azure support only above format, but you can extend the format by editing the demo functions.
For more detail on the Cayenne LPP 2.0 format, please refer to below.
NOTE2: The HS300x driver in the demo firmware supports HS3001, HS3002, HS3003 and HS3004.
R11AN0412EJ0220 Rev.2.20 Page 6 of 27
Jan 22, 2021
LoRaWAN® IoT Demo LPWA IoT Solution with Cloud
2. LoRaWAN Gateway
2.1 How to setup Kerlink LoRaWAN Gateway
This IoT demo uses Kerlink iFemtoCell as LoRaWAN Gateway and also uses Loriot as LoRaWAN Network
Server. LoRaWAN Gateway is tightly coupled with LoRaWAN Network Server using the Network Server
specific LoRaWAN Packet Forwarder. This means you should install the Loriot specific LoRaWAN Packet
Forwarder into the Kerlink iFemtoCell LoRaWAN Gateway.
Step1. Get Login Account for Kerlink Website (https://www.kerlink.com/
Step2. Get Installation Manual for iFemtocell from Kerlink Website.
Step3. Turn on the Kerlink iFemtoCell.
Step4. (optional) Update Kerlink firmware.
Stpe5. Get Login Account for Loriot Website (https://www.loriot.io/
Step6. Get setup guide for Kerlink iFemtoCell.
Step7. Download the Loriot software package (included Packet Forwarder).
Step8. Install and run the Loriot software package on the Kerlink iFemtoCell.
).
).
R11AN0412EJ0220 Rev.2.20 Page 7 of 27
Jan 22, 2021
LoRaWAN® IoT Demo LPWA IoT Solution with Cloud
3. LoRaWAN Network Server
3.1 How to setup the Loriot LoRaWAN Network Server
Loriot provides LoRaWAN Network Server. You should register the LoRaWAN Gateway and LoRaWAN
Devices on the Network Server. You can register the cloud server as the output of the Network Server.
[ Register LoRaWAN Gateway ]
Step1. Login Loriot LoRaWAN Network Server for your region (https://www.loriot.io/login.html
Step2. Go your Loriot Dashboard.
Step3. Click “Networks” > Click “New Network“ > Fill in “Name” field > Click “Create new network”.
Step4. Click “+Add Gateway” > Click “Kerlink iFemtoCell” > Set MAC Address and Location.
Step5. Click “Configure” > Select “Channel Plan” > select Plan (e.g. “AS923” in Japan)
[ Register LoRaWAN Device ]
Step1. Login Loriot LoRaWAN Network Server for your region (https://www.loriot.io/login.html
Step2. Go your Loriot Dashboard.
Step3. Click “APPLICATIONS” > Click “New Application” > Fill in “Name” field.
Step4. Enable “OTTA” on “Features” section
Step5. Click “+Enroll Device” > Select “LoRaWAN 1.0.x” and “OTAA”
Step6. Fill in the “Title”, “Device EUI”, “Application EUI”, “Application Key” > Click “Enroll”
Device EUI is the same as the MAC address labeled on your LoRa Module.
Example settings (Do not use this as your actual settings).
“Device EUI” is 749050FFFE000C26
“Application EUI” is 0123456789ABCDEF
)
)
“Application Key” is 5555555555555555AAAAAAAAAAAAAAAA
R11AN0412EJ0220 Rev.2.20 Page 8 of 27
Jan 22, 2021
LoRaWAN® IoT Demo LPWA IoT Solution with Cloud
[ Register the Cloud ]
Step1. Login Loriot LoRaWAN Network Server for your region (https://www.loriot.io/login.html
Step2. Go your Loriot Dashboard > Click “Applications” > Click “APPLICATIONS”
Step3. Click app name (e.g. “Sample App”) > Click “Output” > Click “Add new output” > Select Cloud
Step4. Enter your cloud credential information follow the instructions on the screen.
[ Cayenne ]
No need to enter your credential information regarding Cayenne.
[ AWS IoT ]
Endpoint Random, Region : You can find in AWS > AWS IoT > Settings > Custom Endpoint
Access ID, Key : You can find in AWS > IAM > Users > “loriot” > security credentials
[ Azure IoT ]
“IoT Hub Name” : your Azure IoT Hub name (e.g. “demoIotHubRliot”)