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

Advertisement

Quick Links

User Manual
DA16200 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 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

    Symbols Configuration in Eclipse for the DA16200 SDK ............19 Configuring the Azure IoT Hub and the DA16200 ..............22 Verify the Connection Between Azure IoT Hub and DA16200 ..........25 Testing the DA16200 Door-Lock ....................28 Open Door ........................... 28 Close Door ..........................
  • Page 3: Figures

    UM-WI-058 DA16200 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 ......................
  • Page 4: Tables

    Figure 64: Created Device Twin Configuration ................... 46 Figure 65: OTA Process of Android Mobile App ................. 47 Figure 66: DA16200 Device (EVK) OTA Process ................47 Figure 67: Azure IoT Hub Device Provisioning Service ..............48 Figure 68: Create DPS ........................48 Figure 69: Configure the Resource group, Name and Region ............
  • Page 5: Terms And Definitions

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

    UM-WI-058 DA16200 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.0 27-May-2022 © 2022 Renesas Electronics...
  • Page 10: Figure 7: Adding Data For Resource Group

    UM-WI-058 DA16200 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.0...
  • 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 devices. To create IoT devices, IoT Hub should be created. User Manual Revision 1.0 27-May-2022 ©...
  • Page 12: Figure 11: Create Resources

    UM-WI-058 DA16200 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.0...
  • Page 13: Figure 13: Create In Iot Hub

    UM-WI-058 DA16200 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.0...
  • Page 14: Figure 15: Next Management

    UM-WI-058 DA16200 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.0...
  • Page 15: Figure 17: Created Iot Hub Configuration

    UM-WI-058 DA16200 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.0...
  • 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 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 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.0...
  • Page 18: Figure 23: Device Registered In The Azure Iot Server

    UM-WI-058 DA16200 Getting Started with Azure® IoT Figure 23: Device Registered in the Azure IoT Server User Manual Revision 1.0 27-May-2022 © 2022 Renesas Electronics CFR0012 18 of 58...
  • Page 19: Symbols Configuration In Eclipse For The Da16200 Sdk

    The DA16200 firmware image is created using the Eclipse IDE and the DA16200 SDK. For instruction on how to set up Eclipse IDE and the DA16200 SDK, see Section 5 of Ref [1]. To build the DA16200 SDK image for Azure IoT, several symbols must be defined in Eclipse.
  • Page 20: Figure 25: Paths And Symbols

    UM-WI-058 DA16200 Getting Started with Azure® IoT 2. Go to Paths and Symbols > GNU C > Symbols. Figure 25: Paths and Symbols 3. To build an image, select the Symbols that user wants, and then click Apply and Close.
  • Page 21: Table 1: Feature Option Map

    Go to sleep 3 mode or normal mode by DPM mode of Easy Setup. Table 4: DPS Feature Define ENABLE_AZURE_DPS_EXAMPLE Run the DPS example of app_dpm_sample.c or iothub_client_dev_sample.c DA16200 SDK. Skip the DPS example of app_dpm_sample.c or iothub_client_dev_sample.c in DA16200 SDK. User Manual Revision 1.0 27-May-2022 © 2022 Renesas Electronics...
  • Page 22: Configuring The Azure Iot Hub And The Da16200

    The Azure IoT Hub requires several parameters to be configured. These parameters are used to connect to the DA16200 and must be set in the DA16200. The connection is necessary for data communication between the Azure IoT Hub and DA16200. Configure parameters of Azure IoT Hub: ●...
  • Page 23: Figure 29: Azure Iot Hub Hostname

    ● IOT-HUB-Connection-string: Access to Azure IoT Hub key. Figure 30: Azure IoT Hub Connection-String There are two ways to configure these parameters in the DA16200: ● Set the default values in the SDK: Edit the above settings in app_thing_manager.h, and then compile and download the firmware...
  • Page 24 UM-WI-058 DA16200 Getting Started with Azure® IoT ● Program the values in the DA16200 NVRAM: In the DA16200 debug console, enter factory mode and set the 4 NVRAM parameters as shown below. [/DA16200] # nvram Command-List is changed, "NVRAM" [/DA16200/NVRAM] # setenv APP_THINGNAME da16200-device-1 [/DA16200/NVRAM] # getenv …….
  • Page 25: Verify The Connection Between Azure Iot Hub And Da16200

    DA16200 EVK and it connects to the Azure IoT Hub. Once connected, the DA16200 EVK reports the items to the Azure IoT Hub and the Azure device twin is updated with the reported items.
  • Page 26: Figure 31: Azure Iot Hub

    UM-WI-058 DA16200 Getting Started with Azure® IoT ● 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 27: Figure 33: Azure Iot Hub Device Twin

    Figure 33: Azure IoT Hub Device Twin Azure Device twin is as shown in Figure 34. The information shown in the device twin should match the information shown in the DA16200 console log. Figure 34: Items in Azure Device Twin User Manual Revision 1.0 27-May-2022 ©...
  • Page 28: Testing The Da16200 Door-Lock

    UM-WI-058 DA16200 Getting Started with Azure® IoT Testing the DA16200 Door-Lock The DA16200 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 29: Figure 36: Open Door In The App

    Azure IoT Hub when the opening door operation is completed. Figure 37: Device Twin When Door Is Open The console log of DA16200 when the opening door operation is completed, is shown below. [mqttOperationCompleteCallback:2102] MQTT_CLIENT_ON_CONNACK & CONNECTION_ACCEPTED: subscribing topics=0x000d ==> elapsed time: 2 ms, total time: 207 ms Info: [app_socket_set_recv_timeout:146] : recv timeout(=120) set OK (socket=0) [SubscribeToMqttProtocol:2441] mqtt_client_subscribe() bypassed ==>...
  • Page 30: Close Door

    UM-WI-058 DA16200 Getting Started with Azure® IoT 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 31: Figure 40: Device Twin When Door Is Closed

    Figure 40: Device Twin When Door Is Closed The console log of DA16200 when the door closing operation is completed, is shown as below. [mqttOperationCompleteCallback:2102] MQTT_CLIENT_ON_CONNACK & CONNECTION_ACCEPTED: subscribing topics=0x000d ==> elapsed time: 0 ms, total time: 204 ms Info: [app_socket_set_recv_timeout:146] : recv timeout(=120) set OK (socket=0) [SubscribeToMqttProtocol:2441] mqtt_client_subscribe() bypassed ==>...
  • Page 32: Ota Update

    UM-WI-058 DA16200 Getting Started with Azure® IoT OTA Update The block diagram for OTA update is shown in Figure Figure 41: Block Diagram for OTA Update The operation of the Android app is shown in Figure Figure 42: OTA Update Operation User Manual Revision 1.0...
  • Page 33: Mobile App Ui

    UM-WI-058 DA16200 Getting Started with Azure® IoT Mobile App UI Figure 43 shows screenshots of the Azure IoT Application on the Android phone or iPhone. Figure 43: Android Application Screenshots User Manual Revision 1.0 27-May-2022 © 2022 Renesas Electronics CFR0012...
  • Page 34: Ota Update

    UM-WI-058 DA16200 Getting Started with Azure® IoT OTA Update Over-The-Air update (OTA) is the process of updating the DA16200 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 35: Figure 45: Create Storage Account

    UM-WI-058 DA16200 Getting Started with Azure® IoT 2. Click Create: Figure 45: Create Storage Account 3. Configure the Resource group, Storage account name, and Region, and then click Review + create: Figure 46: Configure Storage Account User Manual Revision 1.0 27-May-2022 ©...
  • Page 36: Figure 47: Storage Account Validation Done

    UM-WI-058 DA16200 Getting Started with Azure® IoT 4. Once the storage account validation passes, click Create: Figure 47: Storage Account Validation Done 5. Once the storage account deployment is complete, click Go to resource: Figure 48: Storage Account Deployment Done User Manual Revision 1.0...
  • Page 37: Figure 49: Created Storage Account

    UM-WI-058 DA16200 Getting Started with Azure® IoT The created storage account is as shown in Figure Figure 49: Created Storage Account User Manual Revision 1.0 27-May-2022 © 2022 Renesas Electronics CFR0012 37 of 58...
  • Page 38: Create A Container

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

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

    UM-WI-058 DA16200 Getting Started with Azure® IoT Upload a DA16200 Image File To upload the DA16200 firmware image file to the container: 1. In the containers list, click the created container. Figure 54: Container for Uploading the Image 2. Click Upload to upload the DA16200 image file.
  • Page 41: Figure 56: Navigate To The Image

    UM-WI-058 DA16200 Getting Started with Azure® IoT 3. Under the Upload blob section, in Files navigate to the DA16200 image file (saved in local directory, for example, “DA16200_FRTOS-GEN01 ~~.img”), and then click Upload. Figure 56: Navigate to the Image 4. After the file is uploaded, click the image filename to open the URL information as shown in...
  • Page 42: 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. To add configuration in Device Twin for the OTA URL: 1. In the IoT hub, for example da16200-iothub, click Configurations, and then select Add Device Configuration. Figure 59: Add Device Configuration User Manual Revision 1.0...
  • Page 43: Figure 60: Name And Label Section

    2. Under the Name and Label section, do the following: a. In Name, add a name, for example “da16200-ota-version1”. b. Under Label, create a label by adding name and value, for example “da16200-ota-label”, “1.0”. Figure 60: Name and Label Section User Manual Revision 1.0...
  • Page 44: Figure 61: Create Configuration

    UM-WI-058 DA16200 Getting Started with Azure® IoT 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 45: Figure 62: Target Devices Section

    UM-WI-058 DA16200 Getting Started with Azure® IoT c. Click View Devices to verify the device Id. Figure 62: 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 46: Figure 63: Review + Create Section

    UM-WI-058 DA16200 Getting Started with Azure® IoT c. Click Create to create the configuration. Figure 63: Review + Create Section The created configuration is shown in Figure Figure 64: Created Device Twin Configuration User Manual Revision 1.0 27-May-2022 © 2022 Renesas Electronics...
  • Page 47: 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 65: OTA Process of Android Mobile App 2. The process of the DA16200 device (EVK) proceeds as shown in Figure Figure 66: DA16200 Device (EVK) OTA Process User Manual Revision 1.0...
  • Page 48: Appendix A Using The Azure Iot Hub Device Provisioning Service

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

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

    UM-WI-058 DA16200 Getting Started with Azure® IoT 5. After the deployment of DPS is complete, click Go to resource. Figure 71: Go to Resource 6. Select Linked IoT hubs to link the created DPS resource to the Azure IoT Hub.
  • Page 51: Figure 73: Add Link To The Azure Iot Hub

    UM-WI-058 DA16200 Getting Started with Azure® IoT Figure 73: 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 74, and click Save. Figure 74: Configure the Link The IoT Hub that is linked to the DPS appears in the list.
  • Page 52: Manage Enrollments

    Figure 76: 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.0 27-May-2022 ©...
  • Page 53: Configure The Registration Id Parameters In The Da16200 Sdk

    To enable the Device Provisioning Service, define ENABLE_AZURE_DPS_EXAMPLE as 1 in Eclipse as shown in Figure To configure DPS parameters in the DA16200 SDK 1. In the DA16200 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 “da16200-dps-dev1”...
  • Page 54: Figure 79: Dps Registration Id

    For example: #define APP_USER_MY_SYMMETRIC_KEY “ddl6VQRQymWXx30Hxv0TqikjQYzUSl5gmxC9JIpB5Vdi71UJtGRJUwbBxd/7tMOG1CuU43q0RFEodfCIQ tMZCw==” Figure 80: Primary Key of the DPS Registration ID 3. In the DA16200 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.0...
  • Page 55: Figure 81: Id Scope Of The Dps

    UM-WI-058 DA16200 Getting Started with Azure® IoT Figure 81: ID Scope of the DPS 4. Compile and download the image file to the DA16200, and then reset the device. The DPS device is registered as shown in Figure 82 in the linked IoT Hub.
  • Page 56: Revision History

    UM-WI-058 DA16200 Getting Started with Azure® IoT Revision History Revision Date Description 27-May-2022 Initial version. User Manual Revision 1.0 27-May-2022 © 2022 Renesas Electronics CFR0012 56 of 58...
  • Page 57 UM-WI-058 DA16200 Getting Started with Azure® IoT 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 58 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.

Table of Contents