background image

 

 

 

  

 

 

 

 

 

 

 

 

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. 

Summary of Contents for DA16200 PMOD

Page 1: ...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 a...

Page 2: ...ols Configuration in Eclipse for the DA16200 SDK 19 6 Configuring the Azure IoT Hub and the DA16200 22 7 Verify the Connection Between Azure IoT Hub and DA16200 25 8 Testing the DA16200 Door Lock 28 8...

Page 3: ...pply Symbols 20 Figure 27 Azure IoT Hub Device ID 22 Figure 28 Azure IoT Hub Device Primary Key 22 Figure 29 Azure IoT Hub Hostname 23 Figure 30 Azure IoT Hub Connection String 23 Figure 31 Azure IoT...

Page 4: ...T Hub Device Provisioning Service 48 Figure 68 Create DPS 48 Figure 69 Configure the Resource group Name and Region 49 Figure 70 Create Button 49 Figure 71 Go to Resource 50 Figure 72 Linked IoT Hubs...

Page 5: ...IGURE 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 Softw...

Page 6: ...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...

Page 7: ...emonstration This section provides instructions on how to configure Azure IoT Hub to connect to the DA16200 IoT device 4 1 Azure Account and Portal To create an Azure account do the following 1 Go to...

Page 8: ...zure 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...

Page 9: ...ay 2022 CFR0012 9 of 58 2022 Renesas Electronics 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 grou...

Page 10: ...nesas Electronics 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...

Page 11: ...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 devi...

Page 12: ...f 58 2022 Renesas Electronics 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 resourc...

Page 13: ...2022 Renesas Electronics 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...

Page 14: ...s Electronics 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 ti...

Page 15: ...esas Electronics 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 complet...

Page 16: ...tarted 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 devices To...

Page 17: ...012 17 of 58 2022 Renesas Electronics 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 u...

Page 18: ...User Manual Revision 1 0 27 May 2022 CFR0012 18 of 58 2022 Renesas Electronics UM WI 058 DA16200 Getting Started with Azure IoT Figure 23 Device Registered in the Azure IoT Server...

Page 19: ...nd 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 __SUP...

Page 20: ...2022 Renesas Electronics 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 an...

Page 21: ...entered 0 websock_client_dev_sample_entry of iothub_client_dev_sample c in DA16200 SDK is entered not supported OTA because the sample doesn t have Device Twin Table 3 Sleep 2 Mode Feature Define ENA...

Page 22: ...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 par...

Page 23: ...et the default values in the SDK Edit the above settings in app_thing_manager h and then compile and download the firmware image define APP_USER_MYHING_NAME dlg device 1 Device ID define APP_USER_MY_D...

Page 24: ...M setenv APP_HOSTNAME da16200 standard iot hub azure devices net DA16200 NVRAM getenv APP_THINGNAME STR 17 da16200 device 1 APP_DEV_PRIMARY_KEY STR 45 l18H5x4xEKD56McqN 5UT0MNZaX8 oQgHkHh3iXjaf0 APP_H...

Page 25: ...7 2022 17 04 14 Boot Index 0 azure_twin_dpm_auto_start AZURE_IOT on Station Mode for da16200 device 1 dpmAPPManager statusFlag 23 dpmAPPManager DM_NEED_INIT DM_INIT Info azure_dpm_app_init 544 AZURE_U...

Page 26: ...llback 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 Azu...

Page 27: ...I 058 DA16200 Getting Started with Azure IoT 3 Click 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 th...

Page 28: ...WiFiProvisioning app on either an Android or iOS device See document Ref 2 for details on installing and provisioning the mobile app Once provisioning is completed press the menu icon and then select...

Page 29: ...ED 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 elaps...

Page 30: ...0 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 8 2...

Page 31: ...be bypassed elapsed time 13 ms total time 217 ms app_dpm_set_rcv_ready 633 DPM rcv ready suscription completed elapsed time 1 ms total time 218 ms Info deviceMethodCallback 347 method_name AppControl...

Page 32: ...nesas Electronics UM WI 058 DA16200 Getting Started with Azure IoT 8 3 OTA Update The block diagram for OTA update is shown in Figure 41 Figure 41 Block Diagram for OTA Update The operation of the And...

Page 33: ...FR0012 33 of 58 2022 Renesas Electronics UM WI 058 DA16200 Getting Started with Azure IoT 8 4 Mobile App UI Figure 43 shows screenshots of the Azure IoT Application on the Android phone or iPhone Figu...

Page 34: ...Fi using an Azure services storage account Several steps must be completed to setup OTA including 1 Create a storage account 2 Create a container 3 Upload a DA16200 image file to the container 4 Add t...

Page 35: ...8 2022 Renesas Electronics 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 clic...

Page 36: ...ctronics 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 c...

Page 37: ...nual Revision 1 0 27 May 2022 CFR0012 37 of 58 2022 Renesas Electronics UM WI 058 DA16200 Getting Started with Azure IoT The created storage account is as shown in Figure 49 Figure 49 Created Storage...

Page 38: ...Azure IoT 9 2 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 accoun...

Page 39: ...ith 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 C...

Page 40: ...200 Getting Started with Azure IoT 9 3 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 f...

Page 41: ...ate 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 t...

Page 42: ...Image URL 9 4 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 UR...

Page 43: ...s UM WI 058 DA16200 Getting Started with Azure IoT 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...

Page 44: ...n Property Content field which defines the version and URL add a JSON formatted string For example version 1 0 url https da16200otastorage1 blob core windows net da16200 img ontainer DA16200_FRTOS GEN...

Page 45: ...nics 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 vali...

Page 46: ...of 58 2022 Renesas Electronics 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...

Page 47: ...Azure OTA can be executed on the mobile app and the DA16200 device EVK log can be checked during OTA process 1 Click OTA Update to execute OTA update in the Android Mobile App and then the OTA update...

Page 48: ...setup DPS several steps must be completed 1 Create the DPS 2 Manage Enrollments with the DPS 3 Configurate REGISTRATION ID Parameters in the DA16200 SDK A 1 Create the Azure IoT Hub Device Provisionin...

Page 49: ...ics 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 R...

Page 50: ...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 th...

Page 51: ...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 Figu...

Page 52: ...s is the process of registering a device with the Azure IoT Hub To manage enrollments on the Azure IoT Hub 1 Go to the created DPS and click Manage enrollments and then select Add individual enrollmen...

Page 53: ...e list Figure 78 Individual Enrollments A 3 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 sho...

Page 54: ...fine APP_USER_MY_SYMMETRIC_KEY as the Primary Key of the DPS Registration ID For example define APP_USER_MY_SYMMETRIC_KEY ddl6VQRQymWXx30Hxv0TqikjQYzUSl5gmxC9JIpB5Vdi71UJtGRJUwbBxd 7tMOG1CuU43q0RFEodf...

Page 55: ...ronics 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 sho...

Page 56: ...ser Manual Revision 1 0 27 May 2022 CFR0012 56 of 58 2022 Renesas Electronics UM WI 058 DA16200 Getting Started with Azure IoT Revision History Revision Date Description 1 0 27 May 2022 Initial versio...

Page 57: ...may result in modifications or additions APPROVED or unmarked The content of this document has been approved for publication RoHS Compliance Dialog Semiconductor s suppliers certify that its products...

Page 58: ...ubject to change without notice Renesas grants you permission to use these resources only for development of an application that uses Renesas products Other reproduction or use of these resources is s...

Reviews: