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...
Create IoT Hub ....................11 3.2.4 Register Devices ....................15 Configure Azure IoT Hub ....................17 Verify Connection Between Azure IoT Hub and DA16200/DA16600 ......... 20 Door Lock Reference Application ..................... 25 Reference Application in DA16200/DA16600 ..............25 4.1.1 Open Door ......................26 4.1.2...
Page 3
Configure Data as Topics ..................77 Command – MCU to DA16200/DA16600 ............78 B.3.5 Command – DA16200/DA16600 to MCU ............78 B.3.6 DA16200/DA16600 Status – DA16200/DA16600 to MCU ........78 B.3.7 Appendix C Troubleshooting ......................80 Operational Issue ........................ 80 Revision History ..........................81 User Manual Revision 1.4...
Transport Layer Security NVRAM Non-Volatile Random Access Memory Device Provisioning Service References UM-WI-056, DA16200 DA16600 FreeRTOS Getting Started Guide, User Manual, Renesas Electronics UM-WI-042, DA16200 DA16600 Provisioning Mobile App, User Manual, Renesas Electronics User Manual Revision 1.4 Jan. 26, 2024...
Azure IoT Hub A Microsoft Azure account is required to run the door lock reference application. This section provides how to configure Azure IoT Hub for communicating with the DA16200/DA16600 IoT device. Azure Services The Azure Portal provides various services including IoT as shown in...
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 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). 3.2.2 Create Resource Group To register an IoT Hub resource, a resource group should be created.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 5: New Resource Group 4. Add a resource group name and select a region, and then click Review + create to accept the configuration. Figure 6: Adding Data for Resource Group 5.
Create IoT Hub Azure IoT Hub is a managed service that acts as a central message hub for communication between IoT applications and IoT devices that are connected to the DA16200/DA16600. IoT Hub should be created before creating IoT devices.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 11: Select IoT Hub 3. In IoT Hub menu, click Create. Figure 12: Create IoT Hub 4. In the Basics menu, add the IoT hub name and select a region, and then click Next: Networking.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 13: Next Networking 5. In IoT Hub Networking menu, click Next: Management. Figure 14: Next Management 6. In the IoT Hub Management menu, select Pricing and scale tier, and then click Review+create.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 8. After IoT hub deployment is completed, click Go to resource. Figure 17: Completed IoT Hub Deployment The generated IoT hub web page appears. Figure 18: Generated IoT Hub Web Page 3.2.4 Register Devices IoT devices should be added to Azure IoT Hub.
The Azure IoT Hub requires several parameters to be configured. These parameters are used for connecting DA16200/DA16600 device and must be set in the parameter of DA16200/DA16600. The Azure IoT Hub and DA16200/DA16600 need to be connected for data communication.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 23: Device ID Registered in Azure IoT Hub ● Device-Primary-Key: Primary key with device ID registered in Azure IoT Hub Figure 24: Primary Key with Device ID User Manual Revision 1.4 Jan.
"da16XXX-iothub.azure-devices.net" #define APP_USER_MY_IOTHUB_CONN_STRIN "HostName= da16XXX-iothub.azure- devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=a5UBDdFQJ92jVMhVjwJRzY/LR/GfnrEu289Aa806nUw=" ● 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. User Manual Revision 1.4 Jan. 26, 2024 CFR0012 19 of 83...
When parameters listed above are configured and firmware is successfully downloaded, boot the DA16200/DA16600 EVK and connect to the Azure IoT Hub. Once connected, the DA16200/DA16600 EVK reports to the Azure IoT Hub and the Azure device twin is updated with the reported items.
Page 21
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT ………………………………….. [ 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_UPDATE_OTA_UNKNOWN Info: [azure_dpm_app_init:557] : read AZURE_NVRAM_CONFIG_OTA_STATE init status [dpmAPPManager] DM_NEED_CONNECTION DM_NEED_CONNECTION Info: [create_connection_string:740] : connection string : HostName=da16200-standard-iot-hub.azure- devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=Vmt7BP8BsSwNJRm1tSLJUClibls1ApXjpd67HqF91xQ=...
Figure 29: Device Twin in Azure IoT Hub Figure 30 shows the property of Device Twin. The information shown in the device twin should match with the information shown in the DA16200/DA16600 console log. User Manual Revision 1.4 Jan. 26, 2024...
Azure account Figure 31: Structure of Azure IoT Install the mobile application by searching for DA16200 or DA16600 on the Google Pay Store or Apple App Store on the mobile devices. Provisioning is required for connection between DA16200/DA16600 and Router before connecting DA16200/DA16600 with Azure IoT hub.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 32: Open Azure IoT on Mobile Device Figure 33 shows key features of the Azure IoT on the Android phone. Figure 33: Azure IoT on Mobile Device 4.1.1 Open Door Figure 34 shows message flows of opening the door.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 34: Message Flows of Opening Door The operation of opening door in Android app is shown in Figure Figure 35: Opening Door on Mobile App Figure 36 shows the device twin of Azure IoT Hub when the operation of opening door is completed.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 36: Device Twin When Door Is Open When the operation of opening door is completed, the console logs of DA16200/DA16600 are displayed as 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 ==>...
Azure IoT Hub when the operation for closing door is completed. Figure 39: Device Twin When Door Is Closed When the operation for closing door is completed, the console logs of DA16200/DA16600 are displayed as below. [mqttOperationCompleteCallback:2102] MQTT_CLIENT_ON_CONNACK & CONNECTION_ACCEPTED: subscribing topics=0x000d ==>...
Figure 40: Azure IoT Using Firmware Images for AT Commands and Host MCU 4.2.1 Download Package for Door Lock Reference Application in Host MCU A firmware image for AT command and application in MCU are available in the official Renesas website (https://www.renesas.com/us/en/products/wireless-connectivity/wi-fi/low-power-wi-fi). The contents of the package are as follows: ●...
DPM low power mode (DPM LPM) ○ GPIO from the DA16200/DA16600 to host MCU to wake up the MCU in sleep mode Figure 41: Hardware Configuration The pin connections between the DA16200/DA16600 EVB and the EK-RA6M4 board are shown in...
Flow Control (HW/SW) None The DA16200 EVB uses GPIOA_4 and GPIOA_5 for UART1 TX and UART1 RX, and the DA16600 EVB uses GPIOC_6 and GPIOC_7 for UART2 TX and UART2 RX by default. In addition, GND needs to be connected to the host MCU as shown in...
Figure 44: HW Connection for Waking up DA16200/DA16600 The host MCU may be in sleep mode when DA16200/DA16600 wakes up from DPM LPM and needs to send responses to the host MCU. In this scenario, the DA16200/DA16600 needs to wake up the...
// GPIO_11 Figure 45: Default Pin Configuration for Waking Up Host MCU Other GPIOs in the DA16200 EVB can be used for waking up the host MCU as shown in Table For example, GPIOC_6 can be configured for waking up host MCU using the below AT commands...
This can be done by pushing the “Factory_RST” button for 5 seconds as shown in Figure 47 Figure 48, and the logs from DA16200/DA16600 are shown in box below. Figure 47: Factory Reset Button on DA16200 EVB Figure 48: Factory Reset Button on DA16600 EVB User Manual Revision 1.4...
Root CA: X Not ready Cert for Azure service ... invalid AZURE feature...can't start AZURE thread...check again .. UART ready After the factory reset, the DA16200/DA16600 is now ready to enter the Azure-IoT Configuration Settings. 4.2.4 Configure Components for Testing The following information are required for testing the application with Azure IoT server: ●...
Page 37
DA16200 DA16600 Getting Started with Azure® IoT In order to use this script on DA16200, the console should be prompt ;after setting the DA16200 to STA mode, SNTP client enable, and no DPM mode in easy setup through the console.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT The MCU source code can be found in the following file: \MCU\RA6M4\Src\atcmd\at_cmd.c. const char* cmd_set_azure_cfg[MAX_CFG_NUM] = "\r\nAT+"PLATFORM" SET APP_BOARD_FEATURE EVK\r\n", "\r\nAT+"PLATFORM" SET APP_THINGNAME da16200_atcmd_thing\r\n", "\r\nAT+"PLATFORM" SET APP_DEV_PRIMARY_KEY dWKJjGHX9TiCOPheiKyRjjcmmUtBBZsuASBB+K6OoGs=\r\n", "\r\nAT+"PLATFORM" SET APP_HOSTNAME azure-atcmd-iothub.azure-devices.net\r\n", "\r\nAT+"PLATFORM"...
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 49: e studio Project File NOTE When connecting to the RA6M4 MCU for the first time or changing the configuration, follow the step 2 to set up the FSP configuration. 2. Select Configurations.xml to set FSP configuration of the RA6M4 MCU (see Figure 50).
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 51: Thingname/Primarykey/Hostname/IotHub Connection String 5. Select project > Build all to build (see Figure 52). Figure 52: Build Project 6. Select Debug Configurations to set the connection to the RA6M4 MCU (see Figure 53).
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 53: Debug Configurations 7. Change the configuration as shown in Figure 54 and then select the Apply and Debug buttons. Figure 54: Set Debug Configurations 8. The image for host MCU is downloaded to the device.
Page 42
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 9. The following shows the console output of the DA16200/DA16600 after a factory mode reset. System Mode : Soft-AP (1) >>> DHCP Server Started >>> Start DA16X Supplicant ... >>> DA16x Supp Ver2.7 - 2022_03 >>>...
Page 43
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 10. The following shows the console output of the DA16200/DA16600 when setting the Azure IoT configuration through AT commands from an MCU. ======================================================= argc num = 2 argv[0]: AT+AZU argv[1]: SET APP_BOARD_FEATURE EVK...
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 11. The following shows the console output of the DA16200/DA16600 after the Soft AP has been configured and it is waiting to be provisioned by the mobile application. Soft-AP is Ready (d4:3d:39:11:5e:73)
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 4.3.1 Open Door A message flow of opening door is shown in Figure Figure 55: Message Flow of Opening Door The operation for opening door on android app along with the Azure IoT console output displaying the device twin state is shown in Figure 56.
Azure IoT Hub once the operation of opening door has been completed. Figure 57: Device Twin When Door is Opened The console log of the DA16200/DA16600 after the door is opened as below. User Manual Revision 1.4 Jan.
Page 47
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Info: [deviceMethodCallback:565] : method_name: AppControl, Command payload : 17, "0 app_door open" dynamic subscription command ("app_door") send "SERVER_DATA 0 app_door open" to MCU ======================================================= argc num = 2 argv[0]: AT+AZU argv[1]: CMD MCU_DATA 1 mcu_door opened ======================================================= send "CMD_TO_MCU update"...
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 4.3.2 Close Door Message flows of closing door is shown in Figure Figure 58: Message Flows of Closing Door The operation for closing door on android app along with the Azure IoT console output displaying the...
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 60: Device Twin When Door is Closed The console output of the DA16200/DA16600 after the door is closed is shown below: User Manual Revision 1.4 Jan. 26, 2024 CFR0012 49 of 83...
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT OTA Update Over the Air (OTA) is the process of updating the DA16200/DA16600 firmware image through Wi-Fi using an Azure services storage account. To set up OTA update: 1. Create a storage account.
Figure Figure 66: Created Storage Account Create 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.
4. The created container appears in the containers list. Figure 70: Created Container Upload Firmware Image File To upload the DA16200/DA16600 firmware image file to the container: 1. Click the created container in the containers list. User Manual Revision 1.4 Jan.
Figure 71: Container for Uploading Images 2. Click Upload to upload the DA16200/DA16600 image file. Figure 72: 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 –...
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 73: Navigate to Image Figure 74: Uploaded Image 5. Choose Properties, and then click the Copy icon as shown in Figure 75 after the file is uploaded. Save the URL to configure the Azure Device Twin later.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 75: Copy Container URL Add OTA URL to Device Twin For OTA update, a configuration must be added to the IoT Hub that sets the OTA URL in the Device Twin.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 2. Under the Name and Label section, follow the steps below: 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”.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 78: Create Configuration 4. Under the Target Devices section, follow the step below: a. Set Priority, for example “10”. b. Set Target Condition to match the Device ID in the devices of Azure IoT Hub.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT c. Click View Devices to verify the device Id. Figure 79: Target Devices Section 5. Under the Review + create section, follow the steps below: a. Verify the validation is passed. b. Review the configuration that is shown in the text box.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 81: Created Device Twin Configuration 7. The operation of the Android app is shown in Figure Figure 82: OTA Update Operation 8. The message flow of OTA update is shown in...
Azure server to update the MCU firmware through the DA16200/DA16600. Note that the DA16200/DA16600 detects whether the firmware image is for the MCU or for the DA16200/DA16600 depending on the prefix of the firmware image name. If the firmware image is for the MCU, then the firmware image name should be prefixed with “mcu”...
DA16200 DA16600 Getting Started with Azure® IoT Appendix A 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 set up DPS, follow the steps below: 1.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 3. Configure the Resource group, Name and Region as shown in Figure 88, and then click Review + create. Figure 88: Configure Resource Group, Name, and Region 4. After the validation is passed, click Create.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT 5. After the deployment of DPS is complete, click Go to resource. Figure 90: Go to Resource 6. Select Linked IoT hubs to link the created DPS resource to the Azure IoT Hub.
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Figure 92: Add Link to Azure IoT Hub 8. Under Add link to IoT hub section, select the IoT hub and Access Policy as shown in Figure 93, and click Save. Figure 93: Configure Link The IoT Hub that is linked to the DPS appears in the list.
Figure 95: Manage Enrollments 2. In the Add enrollment, follow the steps below, 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.4 Jan. 26, 2024...
To enable the Device Provisioning Service, define ENABLE_AZURE_DPS_EXAMPLE as 1 in the e studio. 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”...
For example: #define APP_USER_MY_SYMMETRIC_KEY “ddl6VQRQymWXx30Hxv0TqikjQYzUSl5gmxC9JIpB5Vdi71UJtGRJUwbBxd/7tMOG1CuU43q0RFEodfCIQ tMZCw==” Figure 99: Primary Key of 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.4...
DA16200 DA16600 Getting Started with Azure® IoT Figure 100: ID Scope of 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.
B.1.1 Setting Mode After uploading a firmware image and rebooting, the DA16200/DA16600 enters setting mode. In this mode, all Azure IoT settings can be configured using the SET command and a specific topic can be configured using the CFG command. For proper operation of Azure IoT, the TLS certificate keys should be set.
DA16200 DA16600 Getting Started with Azure® IoT Figure 103: Provisioning Mode B.1.3 Communication Mode The DA16200/DA16600 Communicating Mode is used by the MCU to communicate (send and receive) topic values with an Azure server (see Figure 104). Figure 104: Communication Mode How to Report Topic and Update Device Twin B.2.1...
Table 5 ● The MCU pushes the topics in Table 5 to the DA16200/DA16600 using AT commands The DA16200/DA16600 facilitates the communication between the MCU and the phone as shown in Figure 105. Table 5: Configuration of Topics Number Name...
Set the period to check a beacon frame from the AP TIM_WAKE_UP Default value is set to10 EX) AT+AZU=SET APP_THINGNAME AssignedDeviceID AT+AZU=SET APP_HOSTNAME azure-atcmd-iothub.azure-devices.net B.3.2 TLS Certificate Table 7: TLS Certificate from MCU to DA16200/DA16600 Start Code Sub Code Type End Code Root CA Self-Signed, well known...
Note: Default pin mux is BMUX, and uses GPIOA2/GPIOA3 for UART1 and GPIOA9 for MCU wakeup. AT+AZU=SET NV_PIN_BMUX BMUX_UART1d AT+AZU=SET NV_PIN_EMUX EMUX_GPIO AT+AZU=SET APP_MCU_WKAEUP_PORT GPIO_UNIT_A AT+AZU=SET APP_MCU_WKAEUP_PIN GPIO_PIN9 B.3.4 Configure Data as Topics Table 9: Configuration Data from MCU to DA16200/DA16600 Head Main Parameters ● number: Index to identify the saved topic...
Table 11: Command from DA16200/DA16600 to MCU Head Main Parameters Description Used by the DA16200/DA16600 to set a CFG parameter in [number] [name] +AZUIOT SERVER_DATA the MCU The value must be the same format as defined by [value] the CFG setting.
Page 79
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Status Value Parameters Need configuration Sent if there is no setting MCU should set and configure with the SET and CFG command Start AP mode Sent when being started to AP mode...
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Appendix C Troubleshooting Operational Issue When UI buttons are not visible or not showing up properly while using the mobile app, try to uninstall and install it again. The first time running the mobile app after reinstalling it, make sure that the app can access the location of the device as described in Test Provisioning on Android/iPhone sections of [2].
UM-WI-058 DA16200 DA16600 Getting Started with Azure® IoT Revision History Revision Date Description Jan. 26, 2024 Added Troubleshooting section Merged documents: Sep. 27, 2023 ● UM-WI-058, DA16200 DA16600 Getting Started with Azure-IoT ● UM-WI-060, DA16200 DA16600 Getting Started with AT- Command for Azure-IoT ●...
Page 82
RoHS Compliance Renesas Electronics’ suppliers certify that its products are in compliance with the requirements of Directive 2011/65/EU of the European Parliament on the restriction of the use of certain hazardous substances in electrical and electronic equipment. RoHS certificates from our suppliers are available on request.
Page 83
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