Renesas DA16200 PMOD User manual

User Manual
DA16200(DA16600) Getting
Started with Azure® IoT
UM-WI-058
Abstract
The focus of this document is to introduce a door-lock example for Azure® IoT. This is a reference
design which includes the Azure® IoT Application. This reference design provides the user an
experience using the Azure® IoT Android/iOS Application.

User Manual
Revision 1.1
01-Sep-2022
CFR0012
2 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
Contents
Abstract................................................................................................................................................ 1
Contents............................................................................................................................................... 2
Figures.................................................................................................................................................. 3
1Terms and Definitions................................................................................................................... 5
2References..................................................................................................................................... 5
3Demonstration Environment........................................................................................................ 6
3.1 Demonstration Prerequisites................................................................................................. 6
4Azure IoT Hub Setup..................................................................................................................... 7
4.1 Azure Account and Portal ..................................................................................................... 7
4.2 Azure Services...................................................................................................................... 7
4.3 Azure Service Configuration for IoT...................................................................................... 8
4.3.1 Creating a Resource Group................................................................................... 8
4.3.2 Create IoT Hub ....................................................................................................11
4.3.3 Create Devices .................................................................................................... 16
5Configuring the Azure IoT Hub and the DA16200(DA16600) .................................................. 19
6Verify the Connection Between Azure IoT Hub and DA16200(DA16600) .............................. 22
7Testing the DA16200(DA16600) Door-Lock .............................................................................. 26
7.1 Open Door...........................................................................................................................26
7.2 Close Door .......................................................................................................................... 28
7.3 OTA Update ........................................................................................................................ 30
7.4 Mobile App UI......................................................................................................................31
8OTA Update.................................................................................................................................. 32
8.1 Create a Storage Account...................................................................................................32
8.2 Create a Container..............................................................................................................36
8.3 Upload a DA16200(DA16600) Image File .......................................................................... 38
8.4 Add the OTA URL to the Device Twin ................................................................................ 40
8.5 Execute OTA Update.......................................................................................................... 45
Appendix A Using the Azure IoT Hub Device Provisioning Service ............................................ 46
A.1 Create the Azure IoT Hub Device Provisioning Service..................................................... 46
A.2 Manage Enrollments...........................................................................................................50
A.3 Configure the REGISTRATION ID Parameters in the DA16200(DA16600) SDK .............. 51
Revision History ................................................................................................................................ 54

User Manual
Revision 1.1
01-Sep-2022
CFR0012
3 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
Figures
Figure 1: Architecture of Azure for IoT .................................................................................................. 6
Figure 2: Azure Portal Services............................................................................................................. 7
Figure 3: Azure IoT Service Configuration ............................................................................................ 8
Figure 4: Create a Resource................................................................................................................. 8
Figure 5: Resource Group..................................................................................................................... 9
Figure 6: New Resource Group............................................................................................................. 9
Figure 7: Adding Data for Resource Group.........................................................................................10
Figure 8: Create Resource Group.......................................................................................................10
Figure 9: Go to Resource Group.........................................................................................................11
Figure 10: Created Resource Group...................................................................................................11
Figure 11: Create Resources .............................................................................................................. 12
Figure 12: IoT Hub...............................................................................................................................12
Figure 13: Create in IoT Hub............................................................................................................... 13
Figure 14: Next Networking................................................................................................................. 13
Figure 15: Next Management.............................................................................................................. 14
Figure 16: IoT Hub Management Menu .............................................................................................. 14
Figure 17: Created IoT Hub Configuration..........................................................................................15
Figure 18: Completed IoT Hub Deployment........................................................................................15
Figure 19: Generated IoT Hub Web Page...........................................................................................16
Figure 20: Devices...............................................................................................................................16
Figure 21: Add Devices....................................................................................................................... 17
Figure 22: Save Devices ..................................................................................................................... 17
Figure 23: Device Registered in the Azure IoT Server........................................................................ 18
Figure 24: Azure IoT Hub Device ID ................................................................................................... 19
Figure 25: Azure IoT Hub Device Primary Key ...................................................................................19
Figure 26: Azure IoT Hub Hostname...................................................................................................20
Figure 27: Azure IoT Hub Connection-String...................................................................................... 20
Figure 28: Azure IoT Hub.................................................................................................................... 24
Figure 29: Azure IoT Hub Device ID ................................................................................................... 24
Figure 30: Azure IoT Hub Device Twin ............................................................................................... 25
Figure 31: Items in Azure Device Twin................................................................................................25
Figure 32: Block Diagram for Opening a Door.................................................................................... 26
Figure 33: Open Door in the App ........................................................................................................ 27
Figure 34: Device Twin When Door Is Open.......................................................................................27
Figure 35: Block Diagram for Closing a Door...................................................................................... 28
Figure 36: Close the Door in the App.................................................................................................. 28
Figure 37: Device Twin When Door Is Closed ....................................................................................29
Figure 38: Block Diagram for OTA Update.......................................................................................... 30
Figure 39: OTA Update Operation ...................................................................................................... 30
Figure 40: Android Application Screenshots ....................................................................................... 31
Figure 41: Storage Accounts............................................................................................................... 32
Figure 42: Create Storage Account.....................................................................................................33
Figure 43: Configure Storage Account................................................................................................33
Figure 44: Storage Account Validation Done......................................................................................34
Figure 45: Storage Account Deployment Done................................................................................... 34
Figure 46: Created Storage Account...................................................................................................35
Figure 47: Containers in Storage Account ..........................................................................................36
Figure 48: Add Container ....................................................................................................................36
Figure 49: Container Details................................................................................................................37
Figure 50: Created Container.............................................................................................................. 37
Figure 51: Container for Uploading the Image.................................................................................... 38
Figure 52: Upload Image..................................................................................................................... 38
Figure 53: Navigate to the Image........................................................................................................ 39
Figure 54: Uploaded Image.................................................................................................................39
Figure 55: Copy Container URL..........................................................................................................40
Figure 56: Add Device Configuration .................................................................................................. 40
Figure 57: Name and Label Section....................................................................................................41

User Manual
Revision 1.1
01-Sep-2022
CFR0012
4 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
Figure 58: Create Configuration.......................................................................................................... 42
Figure 59: Target Devices Section......................................................................................................43
Figure 60: Review + Create Section.................................................................................................... 43
Figure 61: Created Device Twin Configuration ...................................................................................44
Figure 62: OTA Process of Android Mobile App ................................................................................. 45
Figure 63: DA16200 Device (EVK) OTA Process ............................................................................... 45
Figure 64: Azure IoT Hub Device Provisioning Service ...................................................................... 46
Figure 65: Create DPS ........................................................................................................................ 46
Figure 66: Configure the Resource Group, Name, and Region..........................................................47
Figure 67: Create Button..................................................................................................................... 47
Figure 68: Go to Resource.................................................................................................................. 48
Figure 69: Linked IoT Hubs.................................................................................................................48
Figure 70: Add Link to the Azure IoT Hub...........................................................................................49
Figure 71: Configure the Link.............................................................................................................. 49
Figure 72: IoT Hub Linked to the DPS ................................................................................................ 50
Figure 73: Manage Enrollments .......................................................................................................... 50
Figure 74: Add Enrollment................................................................................................................... 51
Figure 75: Individual Enrollments........................................................................................................51
Figure 76: DPS Registration ID........................................................................................................... 52
Figure 77: Primary Key of the DPS Registration ID ............................................................................52
Figure 78: ID Scope of the DPS..........................................................................................................53
Figure 79: DPS Device is Registered..................................................................................................53

User Manual
Revision 1.1
01-Sep-2022
CFR0012
5 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
1 Terms and Definitions
AP Access Point
ADB Android Debug Bridge
API Application Programming Interface
Azure Microsoft Web Services
CFG CONFIGURE
CMD COMMAND
DPM Dynamic Power Management
DTIM Delivery Traffic Indication Map
EVB Evaluation Board
IoT Internet of Things
MCU Micro-Controller Unit
OTA Over-The-Air
RTC Real-Time Clock
SDK Software Development Kit
TIM Traffic Indication MAP
TSL Transport Layer Security
NVRAM Non-Volatile Random Access Memory
DPS Device Provisioning Service
2 References
[1] UM-WI-056-DA16200_DA16600_FreeRTOS_Getting_Started_Guide
[2] UM-WI-042-DA16200_Provisioning_the_Mobile_App
[3] UM-WI-044-DA16600_Provisioning_the_Mobile_App

User Manual
Revision 1.1
01-Sep-2022
CFR0012
6 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
3 Demonstration Environment
This example will demonstrate how to use a mobile application to control a door-lock application
running on a DA16200(DA16600) via an Internet connection and the Microsoft Azure IoT server.
Figure 1: Architecture of Azure for IoT
3.1 Demonstration Prerequisites
●EVK: DA16200(DA16600)
●Router: Connection to internet
●Mobile device: Android application
●Azure account: Free account

User Manual
Revision 1.1
01-Sep-2022
CFR0012
7 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
4 Azure IoT Hub Setup
A Microsoft Azure account is required to test the door-lock example. If an account is not available, a
free account can be created and used for this demonstration. This section provides instructions on
how to configure Azure IoT Hub to connect to the DA16200(DA16600) IoT device.
4.1 Azure Account and Portal
To create an Azure account, do the following:
1. Go to the https://azure.microsoft.com/.
2. Create an Azure account and sign in.
3. Go to Microsoft Azure Portal to use Azure services. (https://azure.microsoft.com/en-
us/features/azure-portal/)
4.2 Azure Services
The Azure Portal provides a list of Azure services as shown in Figure 2.
Figure 2: Azure Portal Services

User Manual
Revision 1.1
01-Sep-2022
CFR0012
8 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
4.3 Azure Service Configuration for IoT
Azure offers a variety of services of which three are required to connect a device to the Azure IoT
server as shown in Figure 3.
●Resource groups
●IoT Hub
●Devices
Figure 3: Azure IoT Service Configuration
4.3.1 Creating a Resource Group
A resource group must be created to register an IoT Hub resource.
1. In Azure services, click Create a resource.
Figure 4: Create a Resource

User Manual
Revision 1.1
01-Sep-2022
CFR0012
9 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
2. Search and click Resource group.
Figure 5: Resource Group
3. Click Create to create a new resource group.
Figure 6: New Resource Group

User Manual
Revision 1.1
01-Sep-2022
CFR0012
10 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
4. Add the resource group name and select the region, and then click Review + create to accept
the configuration.
Figure 7: Adding Data for Resource Group
5. Click Create.
Figure 8: Create Resource Group

User Manual
Revision 1.1
01-Sep-2022
CFR0012
11 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
6. Click Go to resource group.
Figure 9: Go to Resource Group
The resource group is completed.
Figure 10: Created Resource Group
4.3.2 Create IoT Hub
IoT Hub includes Azure IoT devices and the devices are connected to the DA16200(DA16600)
devices. To create IoT devices, IoT Hub should be created.

User Manual
Revision 1.1
01-Sep-2022
CFR0012
12 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
To create IoT Hub:
1. In the created resource group, click Create resources.
Figure 11: Create Resources
2. In Create a resource menu, search and click IoT Hub.
Figure 12: IoT Hub

User Manual
Revision 1.1
01-Sep-2022
CFR0012
13 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
3. In IoT Hub menu, click Create.
Figure 13: Create in IoT Hub
4. In the Basics menu, add the IoT hub name and select a region, and then click Next:
Networking.
Figure 14: Next Networking

User Manual
Revision 1.1
01-Sep-2022
CFR0012
14 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
5. In IoT Hub Networking menu, click Next: Management.
Figure 15: Next Management
6. In the IoT Hub Management menu, select Pricing and scale tier, and then click
Review+create.
Figure 16: IoT Hub Management Menu

User Manual
Revision 1.1
01-Sep-2022
CFR0012
15 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
7. Once the IoT hub configuration is created, click Create.
Figure 17: Created IoT Hub Configuration
8. After IoT hub deployment is completed, click Go to resource.
Figure 18: Completed IoT Hub Deployment

User Manual
Revision 1.1
01-Sep-2022
CFR0012
16 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
The generated IoT hub web page appears.
Figure 19: Generated IoT Hub Web Page
4.3.3 Create Devices
The Azure IoT Hub devices should be created for connection of DA16200(DA16600) devices.
To create devices:
1. In the created IoT Hub, click Devices.
Figure 20: Devices
2. In Devices menu, click Add Device.

User Manual
Revision 1.1
01-Sep-2022
CFR0012
17 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
Figure 21: Add Devices
3. Add the desired Device ID, and then click Save.
Figure 22: Save Devices
4. The device to be used is registered in the Azure IoT server.

User Manual
Revision 1.1
01-Sep-2022
CFR0012
18 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
Figure 23: Device Registered in the Azure IoT Server

User Manual
Revision 1.1
01-Sep-2022
CFR0012
19 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
5 Configuring the Azure IoT Hub and the DA16200(DA16600)
The Azure IoT Hub requires several parameters to be configured. These parameters are used to
connect to the DA16200(DA16600) device and must be set in the parameter of DA16200(DA16600).
The connection is necessary for data communication between the Azure IoT Hub and
DA16200(DA16600) device.
Configure parameters of Azure IoT Hub:
●Device ID: ID registered in Azure IoT Hub device.
Figure 24: Azure IoT Hub Device ID
●Device-Primary-Key: Primary key with device ID registered in Azure IoT Hub.
Figure 25: Azure IoT Hub Device Primary Key

User Manual
Revision 1.1
01-Sep-2022
CFR0012
20 of 56
© 2022 Renesas Electronics
UM-WI-058
DA16200(DA16600) Getting Started with Azure®
IoT
●Hostname: Azure IoT Hub address.
Figure 26: Azure IoT Hub Hostname
●IOT-HUB-Connection-string: Access to Azure IoT Hub key.
Figure 27: Azure IoT Hub Connection-String
There are two ways to configure these parameters in the DA16200(DA16600):
●Set the default values in the SDK:
Edit the above settings in app_thing_manager.h, and then compile (for instruction on how to
compile the DA16200(DA16600) SDK, see Section 5 of Ref [1]) and download the firmware
image
#define APP_USER_MYHING_NAME "da16XXX-device-1" //Device ID
#define APP_USER_MY_DEV_PRIMARY_KEY "kzsauVFTNfZpO1xJHrgXFDjxZ6t9Jbfmd4PgMvx/ixo=”
#define APP_USER_MY_HOST_NAME "da16XXX-iothub.azure-devices.net"
#define APP_USER_MY_IOTHUB_CONN_STRIN "HostName= da16XXX-iothub.azure-
devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=a5UBDdFQJ92jVMhVjwJRzY/LR/GfnrEu289Aa806nUw="
Other manuals for DA16200 PMOD
12
This manual suits for next models
1
Table of contents