From 6f5ef509e0e5a437e1f6220b0d875e4b298b38ae Mon Sep 17 00:00:00 2001 From: andreyla Date: Thu, 17 Sep 2020 21:53:32 +0300 Subject: [PATCH 1/6] Update sample.json --- .../DPC++/GraphTraversal/hidden-markov-models/sample.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json b/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json index 6dadf9de3f..0e807e4b15 100644 --- a/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json +++ b/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json @@ -1,7 +1,7 @@ { "guid": "A63E408B-75ED-4379-A6B5-AF013C0EBA58", "name": "hidden-markov-models", - "categories": [ "Toolkit/Intel® oneAPI Base Toolkit/oneAPI DPC++ Compiler/CPU and GPU" ], + "categories": [ "Toolkit/Base Toolkit/DPC++ Compiler/CPU and GPU" ], "description": "Bitonic Sort using Intel® oneAPI DPC++ Language", "toolchain": [ "dpcpp" ], "targetDevice": [ "CPU", "GPU" ], From afe663ca2dfeaed15d11cc495d22d6ceebffc873 Mon Sep 17 00:00:00 2001 From: andreyla Date: Fri, 25 Sep 2020 21:02:27 +0300 Subject: [PATCH 2/6] Update sample.json --- .../DPC++/GraphTraversal/hidden-markov-models/sample.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json b/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json index 0e807e4b15..e18c544221 100644 --- a/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json +++ b/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json @@ -1,7 +1,7 @@ { "guid": "A63E408B-75ED-4379-A6B5-AF013C0EBA58", "name": "hidden-markov-models", - "categories": [ "Toolkit/Base Toolkit/DPC++ Compiler/CPU and GPU" ], + "categories": [ "Toolkit/Intel® oneAPI Base Toolkit/oneAPI DPC++/C++ Compiler/CPU and GPU" ], "description": "Bitonic Sort using Intel® oneAPI DPC++ Language", "toolchain": [ "dpcpp" ], "targetDevice": [ "CPU", "GPU" ], From 6711aae75c7c7c2034e8a0cddcb75fead71c29cd Mon Sep 17 00:00:00 2001 From: andrey4latyshev Date: Tue, 10 Nov 2020 11:51:27 +0300 Subject: [PATCH 3/6] Update README.md --- .../azure-iothub-telemetry/README.md | 97 ++++++++++++++----- 1 file changed, 74 insertions(+), 23 deletions(-) diff --git a/Tools/IoTConnectionTools/azure-iothub-telemetry/README.md b/Tools/IoTConnectionTools/azure-iothub-telemetry/README.md index e4a9182209..3527372203 100644 --- a/Tools/IoTConnectionTools/azure-iothub-telemetry/README.md +++ b/Tools/IoTConnectionTools/azure-iothub-telemetry/README.md @@ -1,33 +1,84 @@ -# Azure IoTHub Telemetry +# `Azure Telemetry` Sample -## Introduction -This is a simple sample you could use for a quick test of Azure cloud services. +`Azure Telemetry` sample demonstrates how to send messages from a single device to Microsoft Azure IoT Hub via selected protocol. -## What it is -This project demonstrates how to send messages from a single device to Microsoft Azure IoT Hub via chosen protocol. +| Optimized for | Description +|:--- |:--- +| OS | Linux* Ubuntu* 16.04, Linux* Ubuntu* 18.04, +| What you will learn | Use one of the protocols to send events from a device -## Hardware requirements -The minimum requirements are for the device platform to support can be [found here](https://github.com/Azure/azure-iot-sdk-c). +## Purpose +This is a simple code sample that helps user to test the advantages of the Azure cloud services. -## Software requirements -This sample is supported on Linux systems only. +## Key Implementation Details +This sample tests Azure Cloud IoT Hub. There are five protocols to choose from: MQTT, AMQP, HTTP, MQTT over Websockets and AMQP over Websockets. +The sample requires Azure account and created Azure IoT Hub. -This version of the sample has been tested on Ubuntu Linux. This sample requires additional system configuration when using Ubuntu OS. Instructions on how to install the custom provided all dependency libraries for Linux can be [found here](https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/ubuntu_apt-get_sample_setup.md). +##License +Code sample uses MIT License. -## Setup -Create and configure Azure IoTHub on [Microsoft Azure page](https://portal.azure.com/#home). -Detailed instructions are on [Microsoft website](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-through-portal). +##Building the `Azure Telemetry` Sample -Paste the Device Connection String into the following line: -`static const char* connectionString = "[device connection string]"` +### On a Linux* System -Choose one of the protocols to connect: MQTT over websockets, AMQP, AMQP over websockets or HTTP by uncommenting one of the following strings (MQTT protocol is chosen by default): -`//#define SAMPLE_MQTT_OVER_WEBSOCKETS` -`//#define SAMPLE_AMQP` -`//#define SAMPLE_AMQP_OVER_WEBSOCKETS` -`//#define SAMPLE_HTTP` +Perform the following steps: -Build and run the sample. +1. Create Azure IoT Hub using [the instruction](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-create-through-portal) and copy the Primary Connection String. -## Disclaimer -IMPORTANT NOTICE: This software is sample software. It is not designed or intended for use in any medical, life-saving or life-sustaining systems, transportation systems, nuclear systems, or for any other mission-critical application in which the failure of the system could lead to critical injury or death. The software may not be fully tested and may contain bugs or errors; it may not be intended or suitable for commercial release. No regulatory approvals for the software have been obtained, and therefore software may not be certified for use in certain countries or environments. +2. Paste the Primary Connection String into the following line in the sample folder's file cpp/iothub_ll_telemetry_sample.c instead of the string in quotes: + ``` + static const char* connectionString = "[device connection string]" + ``` +3. Run in the terminal: + ``` + cd $ENV{HOME} + git clone https://github.com/Azure/azure-iot-sdk-c.git + cd azure-iot-sdk-c + git submodule update --init + mkdir cmake + cd cmake + cmake .. + ``` + +4. Run the following lines from the sample folder 'azure-iot-telemetry': + ``` + mkdir build + cd build + cmake .. + make all + ``` +5. Run the program using: + ``` + make run + ``` +6. Clean the program using: + ``` + make clean + ``` +## Running the Sample + +### Application Parameters + +There are no editable parameters for this sample. + +### Example of Output + ``` + Creating IoTHub Device handle + The device client is connected to iothub + + Sending Message 1 to IoTHub + Message:{"temperature": 24.716, "humidity":71.651, "scale":Celsius} + confirmation callback received for message 1 with result IOTHUB_CLIENT_CONFIRMATION_OK + + Sending Message 2 to IoTHub + Message:{"temperature": 31.408, "humidity":64.724, "scale":Celsius} + confirmation callback received for message 2 with result IOTHUB_CLIENT_CONFIRMATION_OK + + Sending Message 3 to IoTHub + Message:{"temperature": 26.158, "humidity":73.844, "scale":Celsius} + confirmation callback received for message 3 with result IOTHUB_CLIENT_CONFIRMATION_OK + + Sending Message 4 to IoTHub + Message:{"temperature": 21.599, "humidity":71.308, "scale":Celsius} + confirmation callback received for message 4 with result IOTHUB_CLIENT_CONFIRMATION_OK + ``` From 479e732021f2285133a448b3e03508ae7a2dfec7 Mon Sep 17 00:00:00 2001 From: andrey4latyshev Date: Tue, 10 Nov 2020 12:12:04 +0300 Subject: [PATCH 4/6] Undo sample.json changes --- Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json b/Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json index 07cb897101..0dc1526c64 100644 --- a/Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json +++ b/Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json @@ -1,7 +1,7 @@ { "guid": "F8F830DE-3660-4478-B2FA-22EE492D7120", "name": "Azure IoTHub Telemetry", - "categories": ["Toolkit/Intel® oneAPI IoT Toolkit/IoT Connection Tools"], + "categories": ["Toolkit/Intel® oneAPI Base Toolkit/oneAPI DPC++ Compiler/CPU and GPU"], "description": "Demonstrate how to send messages from a single device to Microsoft Azure IoT Hub via chosen protocol.", "dependencies": ["azure-iot-sdk-c|https://github.com/Azure/azure-iot-sdk-c"], "languages": [{"cpp":{}}], From b428a3ed04711cce6756482d6ca916cef28e7c2a Mon Sep 17 00:00:00 2001 From: andrey4latyshev Date: Tue, 10 Nov 2020 12:19:46 +0300 Subject: [PATCH 5/6] Revert changes --- .../DPC++/GraphTraversal/hidden-markov-models/sample.json | 2 +- Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json b/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json index e18c544221..6dadf9de3f 100644 --- a/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json +++ b/DirectProgramming/DPC++/GraphTraversal/hidden-markov-models/sample.json @@ -1,7 +1,7 @@ { "guid": "A63E408B-75ED-4379-A6B5-AF013C0EBA58", "name": "hidden-markov-models", - "categories": [ "Toolkit/Intel® oneAPI Base Toolkit/oneAPI DPC++/C++ Compiler/CPU and GPU" ], + "categories": [ "Toolkit/Intel® oneAPI Base Toolkit/oneAPI DPC++ Compiler/CPU and GPU" ], "description": "Bitonic Sort using Intel® oneAPI DPC++ Language", "toolchain": [ "dpcpp" ], "targetDevice": [ "CPU", "GPU" ], diff --git a/Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json b/Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json index 0dc1526c64..07cb897101 100644 --- a/Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json +++ b/Tools/IoTConnectionTools/azure-iothub-telemetry/sample.json @@ -1,7 +1,7 @@ { "guid": "F8F830DE-3660-4478-B2FA-22EE492D7120", "name": "Azure IoTHub Telemetry", - "categories": ["Toolkit/Intel® oneAPI Base Toolkit/oneAPI DPC++ Compiler/CPU and GPU"], + "categories": ["Toolkit/Intel® oneAPI IoT Toolkit/IoT Connection Tools"], "description": "Demonstrate how to send messages from a single device to Microsoft Azure IoT Hub via chosen protocol.", "dependencies": ["azure-iot-sdk-c|https://github.com/Azure/azure-iot-sdk-c"], "languages": [{"cpp":{}}], From ab78feca0a32974800909af8973bf79384342993 Mon Sep 17 00:00:00 2001 From: andrey4latyshev Date: Wed, 21 Apr 2021 10:57:25 +0300 Subject: [PATCH 6/6] Readme updated to fix titles and make clear instructions --- .../azure-iothub-telemetry/README.md | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Tools/IoTConnectionTools/azure-iothub-telemetry/README.md b/Tools/IoTConnectionTools/azure-iothub-telemetry/README.md index 8913326040..b3cd15e49b 100644 --- a/Tools/IoTConnectionTools/azure-iothub-telemetry/README.md +++ b/Tools/IoTConnectionTools/azure-iothub-telemetry/README.md @@ -14,13 +14,13 @@ This simple code sample helps the user to test the advantages of the Azure cloud This sample tests Azure Cloud IoT Hub. There are five protocols to choose from; MQTT, AMQP, HTTP, MQTT over Websockets and AMQP over Websockets. The sample requires an Azure account and created Azure IoT Hub. -##License +## License Code samples are licensed under the MIT license. See [License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt) for details. Third party program Licenses can be found here: [third-party-programs.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/third-party-programs.txt) -##Building the `Azure Telemetry` Sample +## Building the `Azure Telemetry` Sample ### On a Linux* System @@ -32,7 +32,17 @@ Perform the following steps: ``` static const char* connectionString = "[device connection string]" ``` -3. Run in the terminal: + +3. Add necessary PPAs and install all the prerequisite packages: + ``` + sudo add-apt-repository -y ppa:mraa/mraa + sudo add-apt-repository -y ppa:aziotsdklinux/ppa-azureiot + sudo apt-get update + sudo apt-get install -y libmraa2 libmraa-dev libmraa-java python-mraa python3-mraa node-mraa mraa-tools pkg-config + sudo apt-get install -y azure-iot-sdk-c-dev + ``` + +4. Run in the terminal: ``` cd $ENV{HOME} git clone https://github.com/Azure/azure-iot-sdk-c.git @@ -43,18 +53,18 @@ Perform the following steps: cmake .. ``` -4. Run the following lines from the sample folder 'azure-iot-telemetry': +5. Run the following lines from the sample folder 'azure-iot-telemetry': ``` mkdir build cd build cmake .. make all ``` -5. Run the program using: +6. Run the program using: ``` make run ``` -6. Clean the program using: +7. Clean the program using: ``` make clean ```