R-Car/Boards/Yocto-Gen3/Azure IoT Edge/v5.5.0

Introduction
This page describes how to build the images to connect to the Azure IoT Hub on the R-Car, and receive telemetry messages from IoT Edge Device.

Set up in the Azure

 * 1) Create an Azure account
 * Create an Azure account with reference to https://azure.microsoft.com/en-us/free/.
 * 1) Create an Azure IoT Hub
 * Create an Azure IoT Hub with reference to Create an IoT hub.
 * 1) Register an Azure Device
 * Access https://portal.azure.com/ and select your IoT Hub.
 * Select "IoT Edge" under "Device Management" in the side menu, and then click "+ Add IoT Edge Device".
 * Azure-device-1.png
 * Then, set an arbitrary name for "Device ID" and click "Save" without changing the other settings.
 * And then, select "IoT Edge" under "Device Management" in the side menu, and click the device ID you created to check the "Primary Connection String".
 * (The "Primary Connection String" is used in Run the sample module.)
 * Azure-device-3.png
 * 1) Add the Azure module
 * Add the Simulated Temperature Sensor module with reference to Deploy a module.

Build

 * 1) Install the required packages
 * 2) Set up initial git configuration
 * 3) Create the following script(build.sh) for building
 * 4) Build
 * target_board_name is specified for each board according to the following table:
 * R-car-sk-target-board-name.png
 * Depending on the performance of the host PC, it may take several hours for the build to complete.
 * When the build completes successfully, you will see the following output:
 * 1) Check the built images
 * The built images are stored in the following:
 * /build/tmp/deploy/images//
 * 1) Write the images to the SD card
 * Write the images to the SD card with reference to Loading kernel and rootfs via eMMC/SD card.
 * Please replace "core-image-weston" with "core-image-minimal".
 * The built images are stored in the following:
 * /build/tmp/deploy/images//
 * 1) Write the images to the SD card
 * Write the images to the SD card with reference to Loading kernel and rootfs via eMMC/SD card.
 * Please replace "core-image-weston" with "core-image-minimal".

Run the sample module

 * 1) Procedure on the target board
 * 2) Turn on the target board
 * 3) Insert the SD card into the target board, and connect the LAN cable to it.
 * 4) Use a microUSB cable to connect the target board, connect a power supply to it, and connect to serial console.
 * 5) Power on.
 * Short-press SW8 "Power" to switch the board on.
 * If the board is attached to the CCPF board, short-press SW4 "Power" instead of SW8.
 * 1) Configure U-Boot to boot from SD card
 * Refer to the Configure U-Boot to boot from SD card.
 * 1) Connect to the IoT Hub
 * Configure to connect to the IoT Hub.
 * 1) Add a write permission to "/etc/iotedge/config.yaml".
 * 2) Set the "Primary Connection String" to device_connection_string.
 * See Register an Azure Device for the "Primary Connection String".
 * 1) Remove a write permission from "/etc/iotedge/config.yaml".
 * 2) Restart the IoT Edge daemon.
 * 3) Check that the IoT Edge daemon is running.
 * Azure-status-no-page.png
 * 1) Check that the following modules are deployed and are running.
 * It may take several minutes for the deployment to complete.
 * Azure-list.png
 * 1) Procedure on the Azure IoT Explorer
 * Check that it receive telemetry messages from the device.
 * 1) Install the Azure IoT Explorer.
 * Download the installer from https://github.com/Azure/azure-iot-explorer/releases/tag/v0.14.1.
 * Use v0.14.1 because v0.14.7(latest version) does not receive any telemetry messages.
 * 1) Launch the Azure IoT Explorer.
 * 2) Get the "Primary Connection String" for the iothubowner.
 * Go the IoT Hub page on the Azure Portal, click your "IoT Hub", "Shared access policies" on the side menu, and then click "iothubowner". Next, copy the "Primary Connection string".
 * Azure-iot-exp-1.png
 * 1) Register your IoT Hub to the IoT Explorer
 * Select the "IoT hubs" in the side menu of the Azure IoT Explorer, and click "+ Add connection".
 * Paste the "Primary Connection string" you copied into the "Connection string" text box, finally click the "Save".
 * 1) Receive telemetry messages
 * Select the "Telemetry" in the side menu, and click "Start".
 * When a message is received, the following message is displayed.
 * Azure-iot-exp-3.png
 * Select the "IoT hubs" in the side menu of the Azure IoT Explorer, and click "+ Add connection".
 * Paste the "Primary Connection string" you copied into the "Connection string" text box, finally click the "Save".
 * 1) Receive telemetry messages
 * Select the "Telemetry" in the side menu, and click "Start".
 * When a message is received, the following message is displayed.
 * Azure-iot-exp-3.png