Renesas DA16200 User Manual
Hide thumbs Also See for DA16200:
Table of Contents

Advertisement

Quick Links

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.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DA16200 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Renesas DA16200

  • Page 1: Abstract

    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...
  • Page 2: Table Of Contents

    4.3.3 Create Devices ....................16 Configuring the Azure IoT Hub and the DA16200(DA16600) ..........19 Verify the Connection Between Azure IoT Hub and DA16200(DA16600) ......22 Testing the DA16200(DA16600) Door-Lock ................26 Open Door ........................... 26 Close Door .......................... 28 OTA Update ........................
  • Page 3: Figures

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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 ......................
  • Page 4 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 ............
  • Page 5: Terms And Definitions

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Terms and Definitions Access Point Android Debug Bridge Application Programming Interface Azure Microsoft Web Services CONFIGURE COMMAND Dynamic Power Management DTIM Delivery Traffic Indication Map Evaluation Board Internet of Things Micro-Controller Unit Over-The-Air Real-Time Clock...
  • Page 6: Demonstration Environment

    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 Demonstration Prerequisites ●...
  • Page 7: 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. Azure Account and Portal To create an Azure account, do the following: 1.
  • Page 8: Azure Service Configuration For Iot

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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 ● Resource groups ● IoT Hub ●...
  • Page 9: Figure 5: Resource Group

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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 9 of 56 © 2022 Renesas Electronics...
  • Page 10: Figure 7: Adding Data For Resource Group

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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...
  • Page 11: Create Iot Hub

    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...
  • Page 12: Figure 11: Create Resources

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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...
  • Page 13: Figure 13: Create In Iot Hub

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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...
  • Page 14: Figure 15: Next Management

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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...
  • Page 15: Figure 17: Created Iot Hub Configuration

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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...
  • Page 16: Create Devices

    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.
  • Page 17: Figure 21: Add Devices

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 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...
  • Page 18: Figure 23: Device Registered In The Azure Iot Server

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Figure 23: Device Registered in the Azure IoT Server User Manual Revision 1.1 01-Sep-2022 CFR0012 18 of 56 © 2022 Renesas Electronics...
  • Page 19: 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.
  • Page 20: Figure 26: Azure Iot Hub Hostname

    ● 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=”...
  • Page 21 UM-WI-058 DA16200(DA16600) Getting Started with Azure® ● Program the values in the DA16200(DA16600) NVRAM: In the DA16200(DA16600) debug console, enter factory mode and set the 4 NVRAM parameters as shown below. [/DA16200 or /DA16600] # nvram Command-List is changed, "NVRAM"...
  • Page 22: Verify The Connection Between Azure Iot Hub And Da16200(Da16600)

    After the 4 parameters mentioned in Section 5 are set up completely and the firmware is downloaded, boot the DA16200(DA16600) EVK and it connects to the Azure IoT Hub. Once connected, the DA16200(DA16600) EVK reports the items to the Azure IoT Hub and the Azure device twin is updated with the reported items.
  • Page 23 UM-WI-058 DA16200(DA16600) Getting Started with Azure® ● Log of the connection between the DA16600 EVK and Azure IoT Hub Wakeup source is 0x4 [dpm_init_retmemory] DPM INIT CONFIGURATION(1) ****************************************************** DA16600 SDK Information * --------------------------------------------------- * - CPU Type : Cortex-M4 (120MHz) * - OS Type : FreeRTOS 10.4.3...
  • Page 24: Figure 28: Azure Iot Hub

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® ● Log of items reported to the Azure IoT Hub Info: [deviceTwinCallback:463] : Report => {"temperature":23,"battery":100,"doorStateChange":0,"openMethod":"none","doorState":false,"doorBell":false,"do orOpenMode":0,"OTAupdate":0,"OTAresult":"OTA_UNKNOWN","OTAversion":"none"} ● Updated items in the Azure Device Twin To check updated items in the Azure Device Twin:...
  • Page 25: Figure 30: Azure Iot Hub Device Twin

    Figure 30: Azure IoT Hub Device Twin Azure Device twin is as shown in Figure 31. The information shown in the device twin should match the information shown in the DA16200(DA16600) console log. Figure 31: Items in Azure Device Twin User Manual Revision 1.1...
  • Page 26: Testing The Da16200(Da16600) Door-Lock

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Testing the DA16200(DA16600) Door-Lock The DA16200(DA16600) and Azure IoT example can be tested with the Dialog WiFiProvisioning app on either an Android or iOS device. See document Ref. for details on installing and provisioning the mobile app.
  • Page 27: Figure 33: Open Door In The App

    Azure IoT Hub when the opening door operation is completed. Figure 34: Device Twin When Door Is Open The console log of DA16200(DA16600) when the opening door operation is completed, is shown below. [mqttOperationCompleteCallback:2102] MQTT_CLIENT_ON_CONNACK & CONNECTION_ACCEPTED: subscribing topics=0x000d ==>...
  • Page 28: Close Door

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Info: [deviceMethodCallback:435] : Report => {"temperature":23,"battery":100,"doorStateChange":1,"openMethod":"app","doorState":true,"doorBell":false,"door OpenMode":0,"OTAupdate":0,"OTAresult":"OTA_UNKNOWN","OTAversion":"none"} Info: [publishDeviceTwinGetMsg:1136] : publish reported data OK Info: [removeExpiredTwinRequests:1260] : ack_waiting_queue timeout & removed [app_dpm_set_recv_timeout_flag:556] DPM_RCV_OK_SLEEP set ==> elapsed time: 1162 ms, total time: 1379 ms Device Twin reported properties update completed with result: 204...
  • Page 29: Figure 37: Device Twin When Door Is Closed

    Azure IoT Hub when the door closing operation is completed. Figure 37: Device Twin When Door Is Closed The console log of DA16200(DA16600) when the door closing operation is completed, is shown as below. [mqttOperationCompleteCallback:2102] MQTT_CLIENT_ON_CONNACK & CONNECTION_ACCEPTED: subscribing topics=0x000d ==>...
  • Page 30: Ota Update

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® OTA Update The block diagram for OTA update is shown in Figure Figure 38: Block Diagram for OTA Update The operation of the Android app is shown in Figure Figure 39: OTA Update Operation User Manual Revision 1.1...
  • Page 31: Mobile App Ui

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Mobile App UI Figure 40 shows screenshots of the Azure IoT Application on the Android phone or iPhone. Figure 40: Android Application Screenshots User Manual Revision 1.1 01-Sep-2022 CFR0012 31 of 56 © 2022 Renesas Electronics...
  • Page 32: Ota Update

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® OTA Update Over-The-Air update (OTA) is the process of updating the DA16200(DA16600) firmware through Wi- Fi using an Azure services storage account. Several steps must be completed to setup OTA including: 1. Create a storage account.
  • Page 33: Figure 42: Create Storage Account

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 2. Click Create: Figure 42: Create Storage Account 3. Configure the Resource group, Storage account name, and Region, and then click Review + create: Figure 43: Configure Storage Account User Manual Revision 1.1 01-Sep-2022...
  • Page 34: Figure 44: Storage Account Validation Done

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 4. Once the storage account validation passes, click Create: Figure 44: Storage Account Validation Done 5. Once the storage account deployment is complete, click Go to resource: Figure 45: Storage Account Deployment Done User Manual Revision 1.1...
  • Page 35: Figure 46: Created Storage Account

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® The created storage account is as shown in Figure Figure 46: Created Storage Account User Manual Revision 1.1 01-Sep-2022 CFR0012 35 of 56 © 2022 Renesas Electronics...
  • Page 36: Create A Container

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Create a Container A container must be created in the Azure services storage account to store the DA16200(DA16600) image file for OTA update. To create a container: 1. In the created storage account, click Containers.
  • Page 37: Figure 49: Container Details

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 3. Under the New container section, enter a name (for example, “da16XXX-img-container”) and select Container (anonymous read access for containers and blobs) as the Public access level, and then click Create. Figure 49: Container Details The created container appears in the containers list.
  • Page 38: Upload A Da16200(Da16600) Image File

    Figure 51: Container for Uploading the Image 2. Click Upload to upload the DA16200(DA16600) image file. Figure 52: Upload Image 3. Under the Upload blob section, in Files navigate to the DA16200(DA16600 image) file saved in local directory: ● In case of DA16200 ○...
  • Page 39: Figure 53: Navigate To The Image

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® And click Upload and then uploaded image files are appeared as shown in Figure Figure 53: Navigate to the Image Figure 54: Uploaded Image 4. After the file is uploaded, click Properties and then click the Copy icon as shown in Figure Save the URL to configure the Azure Device Twin later.
  • Page 40: Add The Ota Url To The Device Twin

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Figure 55: Copy Container URL Add the OTA URL to the Device Twin For OTA update, a configuration must be added to the IoT Hub that sets the OTA URL in the Device Twin.
  • Page 41: Figure 57: Name And Label Section

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 2. Under the Name and Label section, do the following: a. In Name, add a name, for example “da16XXX-ota-version1”. b. Under Label, create a label by adding name and value, for example “da16XXX-ota-label”, “1.0”.
  • Page 42: Figure 58: Create Configuration

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 3. Under the Twin Settings section, do the following: a. Set Device Twin Property to: “properties.desired.fwupdate”. b. In the Device Twin Property Content field, which defines the version and URL, add a JSON formatted string.
  • Page 43: Figure 59: Target Devices Section

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® c. Click View Devices to verify the device Id. Figure 59: Target Devices Section 5. Under the Review + create section, do the following: a. Verify the validation is passed. b. Review the configuration that is shown in the text box.
  • Page 44: Figure 61: Created Device Twin Configuration

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® The created configuration is shown in Figure Figure 61: Created Device Twin Configuration User Manual Revision 1.1 01-Sep-2022 CFR0012 44 of 56 © 2022 Renesas Electronics...
  • Page 45: Execute Ota Update

    1. Click OTA Update to execute OTA update in the Android Mobile App, and then the OTA update’s process proceeds as shown in Figure Figure 62: OTA Process of Android Mobile App 2. The process of the DA16200 device (EVK) proceeds as shown in Figure Figure 63: DA16200 Device (EVK) OTA Process User Manual Revision 1.1...
  • Page 46: Appendix A Using The Azure Iot Hub Device Provisioning Service

    DA16200(DA16600) Getting Started with Azure® Appendix A Using the Azure IoT Hub Device Provisioning Service Device Provisioning Service (DPS) is a process for registering the DA16200(DA16600) device on the Azure IoT Hub. To setup DPS, several steps must be completed: 1.
  • Page 47: Figure 66: Configure The Resource Group, Name, And Region

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 3. Configure the Resource group, Name and Region as shown in Figure 66, and then click Review + create. Figure 66: Configure the Resource Group, Name, and Region 4. After the validation is passed, click Create.
  • Page 48: Figure 68: Go To Resource

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® 5. After the deployment of DPS is complete, click Go to resource. Figure 68: Go to Resource 6. Select Linked IoT hubs to link the created DPS resource to the Azure IoT Hub. Figure 69: Linked IoT Hubs 7.
  • Page 49: Figure 70: Add Link To The Azure Iot Hub

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Figure 70: Add Link to the Azure IoT Hub 8. Under Add link to IoT hub section, select the IoT hub and Access Policy as shown in Figure 71, and click Save. Figure 71: Configure the Link The IoT Hub that is linked to the DPS appears in the list.
  • Page 50: Manage Enrollments

    Figure 73: Manage Enrollments 2. In the Add enrollment, do the following, and then click Save: a. In Mechanism, select “Symmetric Key”. b. In Registration ID, enter value for the device, for example “da16200-dps-dev1”. User Manual Revision 1.1 01-Sep-2022...
  • Page 51: Configure The Registration Id Parameters In The Da16200(Da16600) Sdk

    To enable the Device Provisioning Service, define ENABLE_AZURE_DPS_EXAMPLE as 1 in Eclipse as shown in . To configure DPS parameters in the DA16200(DA16600) SDK 1. In the DA16200(DA16600) SDK, edit app_thing_manager.h and define APP_USER_MY_THING_NAME as the DPS Registration ID. For example: #define APP_USER_MY_THING_NAME “da16XXX-dps-dev1”...
  • Page 52: Figure 76: Dps Registration Id

    For example: #define APP_USER_MY_SYMMETRIC_KEY “ddl6VQRQymWXx30Hxv0TqikjQYzUSl5gmxC9JIpB5Vdi71UJtGRJUwbBxd/7tMOG1CuU43q0RFEodfCIQ tMZCw==” Figure 77: Primary Key of the DPS Registration ID 3. In the DA16200(DA16600) SDK, edit app_azure_user_conf.h and define ID_SCOPE as the ID Scope of the DPS overview window. For example: #define ID_SCOPE “0ne005E7EE4” User Manual Revision 1.1...
  • Page 53: Figure 78: Id Scope Of The Dps

    DA16200(DA16600) Getting Started with Azure® Figure 78: ID Scope of the DPS 4. After enabled DPS feature is defined in app_azure_user_conf.h of the DA16200(DA16600) SDK as follows , compile it and download the image file to the device, and then reset the device.
  • Page 54: Revision History

    UM-WI-058 DA16200(DA16600) Getting Started with Azure® Revision History Revision Date Description 01-Sep-2022 Added description of DA16600 27-May-2022 Initial version. User Manual Revision 1.1 01-Sep-2022 CFR0012 54 of 56 © 2022 Renesas Electronics...
  • Page 55 UM-WI-058 DA16200(DA16600) Getting Started with Azure® Status Definitions Status Definition DRAFT The content of this document is under review and subject to formal approval, which may result in modifications or additions. APPROVED The content of this document has been approved for publication.
  • Page 56 Renesas disclaims responsibility for, and you will fully indemnify Renesas and its representatives against, any claims, damages, costs, losses, or liabilities arising out of your use of these resources. Renesas' products are provided only subject to Renesas' Terms and Conditions of Sale or other applicable terms agreed to in writing.

This manual is also suitable for:

Da16600

Table of Contents