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...
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 ..........................
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 ............
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...
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 ●...
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.
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 ●...
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...
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...
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...
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...
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...
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.
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...
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.
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.
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: ●...
● 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 …….
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.
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:...
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.
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 ==>...
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 ==>...
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...
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.
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...
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.
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.
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.
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...
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...
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...
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.
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.
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...
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.
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.
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.
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.
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”...
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...
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 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.
Need help?
Do you have a question about the DA16200 and is the answer not in the manual?
Questions and answers